{\rtf1\windows \deff0{\fonttbl
{\f0\fswiss MS Sans Serif;}{\f1\fmodern Courier New;}{\f2\ftech Symbol;}}\fs20
\page #{\footnote hcAbout}${\footnote \pard{}About this help file}\pard{\fs24\b About this help file}\par\par\pard{}This file was made with the help of {\ul Makertf 3.12b-1}{\v hcMakertf} from the input file make.texi.\par\parINFO-DIR-SECTION GNU Packages
{START-INFO-DIR-ENTRY
\pard{}* Make: (make).            Remake files automatically.\line
END-INFO-DIR-ENTRY\par
\pard{}}\par
{\pard{}This file documents the GNU Make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them.\par
\par
\pard{}This is Edition 0.54, last updated 09 September 1999, of {\i The GNU Make Manual}, for {\f1{}make}, Version 3.78.1.\par
\par
\pard{}Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99         Free Software Foundation, Inc.\par
\par
\pard{}Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.\par
\par
\pard{}Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.\par
\par
\pard{}Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  }\par
\par
{\page\pard Node: {\b Top}, \keepn Next: {\uldb Overview}{\v Overview}, Prev: {\uldb }{\v }, Up: {\uldb (dir)}{\v Top @dir.hlp}\tab\tab{\uldb About this help file}{\v hcAbout}\line
K{\footnote K Top}
#{\footnote Top}
${\footnote \pard{}Make}\par
\pard\pard{\fs24\b Make}\par
\par
\pard{}The GNU {\f1{}make} utility automatically determines which pieces of a large program need to be recompiled, and issues the commands to recompile them.\par
\par
\pard{}This edition of the {\i GNU Make Manual}, last updated 09 September 1999, documents GNU {\f1{}make} Version 3.78.1.\par
\par
\pard{}This manual describes {\f1{}make} and contains the following chapters: }\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Overview}{\v Overview}\tab Overview of {\f1{}make}.\par
{\uldb Introduction}{\v Introduction}\tab An introduction to {\f1{}make}.\par
{\uldb Makefiles}{\v Makefiles}\tab Makefiles tell {\f1{}make} what to do.\par
{\uldb Rules}{\v Rules}\tab Rules describe when a file must be remade.\par
{\uldb Commands}{\v Commands}\tab Commands say how to remake a file.\par
{\uldb Using Variables}{\v Using_Variables}\tab You can use variables to avoid repetition.\par
{\uldb Conditionals}{\v Conditionals}\tab Use or ignore parts of the makefile based on the values of variables.\par
{\uldb Functions}{\v Functions}\tab Many powerful ways to manipulate text.\par
{\uldb Invoking make}{\v Running}\tab How to invoke {\f1{}make} on the command line.\par
{\uldb Implicit Rules}{\v Implicit_Rules}\tab Use implicit rules to treat many files alike, based on their file names.\par
{\uldb Archives}{\v Archives}\tab How {\f1{}make} can update library archives.\par
{\uldb Features}{\v Features}\tab Features GNU {\f1{}make} has over other {\f1{}make}s.\par
{\uldb Missing}{\v Missing}\tab What GNU {\f1{}make} lacks from other {\f1{}make}s.\par
{\uldb Makefile Conventions}{\v Makefile_Conventions}\tab Conventions for makefiles in GNU programs.\par
{\uldb Quick Reference}{\v Quick_Reference}\tab A quick reference for experienced users.\par
{\uldb Make Errors}{\v Make_Errors}\tab A list of common errors generated by {\f1{}make}.\par
{\uldb Complex Makefile}{\v Complex_Makefile}\tab A real example of a straightforward, but nontrivial, makefile.\par
{\uldb Concept Index}{\v Concept_Index}\tab Index of Concepts\par
{\uldb Name Index}{\v Name_Index}\tab Index of Functions, Variables, & Directives\par
\par
  --- The Detailed Node Listing ---\par
\par
  Overview of {\f1{}make}\par
\par
 \par
{\uldb Preparing}{\v Preparing}\tab Preparing and Running Make\par
{\uldb Reading}{\v Reading}\tab On Reading this Text\par
{\uldb Bugs}{\v Bugs}\tab Problems and Bugs\par
\par
  An Introduction to Makefiles\par
\par
 \par
{\uldb Rule Introduction}{\v Rule_Introduction}\tab What a rule looks like.\par
{\uldb Simple Makefile}{\v Simple_Makefile}\tab A Simple Makefile\par
{\uldb How Make Works}{\v How_Make_Works}\tab How {\f1{}make} Processes This Makefile\par
{\uldb Variables Simplify}{\v Variables_Simplify}\tab Variables Make Makefiles Simpler\par
{\uldb make Deduces}{\v make_Deduces}\tab Letting {\f1{}make} Deduce the Commands\par
{\uldb Combine By Prerequisite}{\v Combine_By_Prerequisite}\tab Another Style of Makefile\par
{\uldb Cleanup}{\v Cleanup}\tab Rules for Cleaning the Directory\par
\par
  Writing Makefiles\par
\par
 \par
{\uldb Makefile Contents}{\v Makefile_Contents}\tab What makefiles contain.\par
{\uldb Makefile Names}{\v Makefile_Names}\tab How to name your makefile.\par
{\uldb Include}{\v Include}\tab How one makefile can use another makefile.\par
{\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}\tab The environment can specify extra makefiles.\par
{\uldb Remaking Makefiles}{\v Remaking_Makefiles}\tab How makefiles get remade.\par
{\uldb Overriding Makefiles}{\v Overriding_Makefiles}\tab How to override part of one makefile with another makefile.\par
{\uldb Reading Makefiles}{\v Reading_Makefiles}\tab How makefiles are parsed.\par
\par
  Writing Rules\par
\par
 \par
{\uldb Rule Example}{\v Rule_Example}\tab An example explained.\par
{\uldb Rule Syntax}{\v Rule_Syntax}\tab General syntax explained.\par
{\uldb Wildcards}{\v Wildcards}\tab Using wildcard characters such as `*'.\par
{\uldb Directory Search}{\v Directory_Search}\tab Searching other directories for source files.\par
{\uldb Phony Targets}{\v Phony_Targets}\tab Using a target that is not a real file's name.\par
{\uldb Force Targets}{\v Force_Targets}\tab You can use a target without commands or prerequisites to mark other targets as phony.\par
{\uldb Empty Targets}{\v Empty_Targets}\tab When only the date matters and the files are empty.\par
{\uldb Special Targets}{\v Special_Targets}\tab Targets with special built-in meanings.\par
{\uldb Multiple Targets}{\v Multiple_Targets}\tab When to make use of several targets in a rule.\par
{\uldb Multiple Rules}{\v Multiple_Rules}\tab How to use several rules with the same target.\par
{\uldb Static Pattern}{\v Static_Pattern}\tab Static pattern rules apply to multiple targets and can vary the prerequisites according to the target name.\par
{\uldb Double-Colon}{\v Double_Colon}\tab How to use a special kind of rule to allow several independent rules for one target.\par
{\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}\tab How to automatically generate rules giving prerequisites from source files themselves.\par
\par
  Using Wildcard Characters in File Names\par
\par
 \par
{\uldb Wildcard Examples}{\v Wildcard_Examples}\tab Several examples\par
{\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}\tab Problems to avoid.\par
{\uldb Wildcard Function}{\v Wildcard_Function}\tab How to cause wildcard expansion where it does not normally take place.\par
\par
  Searching Directories for Prerequisites\par
\par
 \par
{\uldb General Search}{\v General_Search}\tab Specifying a search path that applies to every prerequisite.\par
{\uldb Selective Search}{\v Selective_Search}\tab Specifying a search path for a specified class of names.\par
{\uldb Search Algorithm}{\v Search_Algorithm}\tab When and how search paths are applied.\par
{\uldb Commands/Search}{\v Commands_Search}\tab How to write shell commands that work together with search paths.\par
{\uldb Implicit/Search}{\v Implicit_Search}\tab How search paths affect implicit rules.\par
{\uldb Libraries/Search}{\v Libraries_Search}\tab Directory search for link libraries.\par
\par
  Static Pattern Rules\par
\par
 \par
{\uldb Static Usage}{\v Static_Usage}\tab The syntax of static pattern rules.\par
{\uldb Static versus Implicit}{\v Static_versus_Implicit}\tab When are they better than implicit rules?\par
\par
  Writing the Commands in Rules\par
\par
 \par
{\uldb Echoing}{\v Echoing}\tab How to control when commands are echoed.\par
{\uldb Execution}{\v Execution}\tab How commands are executed.\par
{\uldb Parallel}{\v Parallel}\tab How commands can be executed in parallel.\par
{\uldb Errors}{\v Errors}\tab What happens after a command execution error.\par
{\uldb Interrupts}{\v Interrupts}\tab What happens when a command is interrupted.\par
{\uldb Recursion}{\v Recursion}\tab Invoking {\f1{}make} from makefiles.\par
{\uldb Sequences}{\v Sequences}\tab Defining canned sequences of commands.\par
{\uldb Empty Commands}{\v Empty_Commands}\tab Defining useful, do-nothing commands.\par
\par
  Recursive Use of {\f1{}make}\par
\par
 \par
{\uldb MAKE Variable}{\v MAKE_Variable}\tab The special effects of using {\f1{}$(MAKE)}.\par
{\uldb Variables/Recursion}{\v Variables_Recursion}\tab How to communicate variables to a sub-{\f1{}make}.\par
{\uldb Options/Recursion}{\v Options_Recursion}\tab How to communicate options to a sub-{\f1{}make}.\par
{\uldb -w Option}{\v _w_Option}\tab How the {\f1{}-w} or {\f1{}--print-directory} option helps debug use of recursive {\f1{}make} commands.\par
\par
  How to Use Variables\par
\par
 \par
{\uldb Reference}{\v Reference}\tab How to use the value of a variable.\par
{\uldb Flavors}{\v Flavors}\tab Variables come in two flavors.\par
{\uldb Advanced}{\v Advanced}\tab Advanced features for referencing a variable.\par
{\uldb Values}{\v Values}\tab All the ways variables get their values.\par
{\uldb Setting}{\v Setting}\tab How to set a variable in the makefile.\par
{\uldb Appending}{\v Appending}\tab How to append more text to the old value of a variable.\par
{\uldb Override Directive}{\v Override_Directive}\tab How to set a variable in the makefile even if the user has set it with a command argument.\par
{\uldb Defining}{\v Defining}\tab An alternate way to set a variable to a verbatim string.\par
{\uldb Environment}{\v Environment}\tab Variable values can come from the environment.\par
{\uldb Automatic}{\v Automatic}\tab Some special variables have predefined meanings for use with implicit rules.\par
\par
  Advanced Features for Reference to Variables\par
\par
 \par
{\uldb Substitution Refs}{\v Substitution_Refs}\tab Referencing a variable with substitutions on the value.\par
{\uldb Computed Names}{\v Computed_Names}\tab Computing the name of the variable to refer to.\par
\par
  Conditional Parts of Makefiles\par
\par
 \par
{\uldb Conditional Example}{\v Conditional_Example}\tab Example of a conditional\par
{\uldb Conditional Syntax}{\v Conditional_Syntax}\tab The syntax of conditionals.\par
{\uldb Testing Flags}{\v Testing_Flags}\tab Conditionals that test flags.\par
\par
  Functions for Transforming Text\par
\par
 \par
{\uldb Syntax of Functions}{\v Syntax_of_Functions}\tab How to write a function call.\par
{\uldb Text Functions}{\v Text_Functions}\tab General-purpose text manipulation functions.\par
{\uldb File Name Functions}{\v File_Name_Functions}\tab Functions for manipulating file names.\par
{\uldb Foreach Function}{\v Foreach_Function}\tab Repeat some text with controlled variation.\par
{\uldb Call Function}{\v Call_Function}\tab Expand a user-defined function.\par
{\uldb Origin Function}{\v Origin_Function}\tab Find where a variable got its value.\par
{\uldb Shell Function}{\v Shell_Function}\tab Substitute the output of a shell command.\par
\par
  How to Run {\f1{}make}\par
\par
 \par
{\uldb Makefile Arguments}{\v Makefile_Arguments}\tab How to specify which makefile to use.\par
{\uldb Goals}{\v Goals}\tab How to use goal arguments to specify which parts of the makefile to use.\par
{\uldb Instead of Execution}{\v Instead_of_Execution}\tab How to use mode flags to specify what kind of thing to do with the commands in the makefile other than simply execute them.\par
{\uldb Avoiding Compilation}{\v Avoiding_Compilation}\tab How to avoid recompiling certain files.\par
{\uldb Overriding}{\v Overriding}\tab How to override a variable to specify an alternate compiler and other things.\par
{\uldb Testing}{\v Testing}\tab How to proceed past some errors, to test compilation.\par
{\uldb Options Summary}{\v Options_Summary}\tab Summary of Options\par
\par
  Using Implicit Rules\par
\par
 \par
{\uldb Using Implicit}{\v Using_Implicit}\tab How to use an existing implicit rule to get the commands for updating a file.\par
{\uldb Catalogue of Rules}{\v Catalogue_of_Rules}\tab A list of built-in implicit rules.\par
{\uldb Implicit Variables}{\v Implicit_Variables}\tab How to change what predefined rules do.\par
{\uldb Chained Rules}{\v Chained_Rules}\tab How to use a chain of implicit rules.\par
{\uldb Pattern Rules}{\v Pattern_Rules}\tab How to define new implicit rules.\par
{\uldb Last Resort}{\v Last_Resort}\tab How to defining commands for rules which cannot find any.\par
{\uldb Suffix Rules}{\v Suffix_Rules}\tab The old-fashioned style of implicit rule.\par
{\uldb Implicit Rule Search}{\v Implicit_Rule_Search}\tab The precise algorithm for applying implicit rules.\par
\par
  Defining and Redefining Pattern Rules\par
\par
 \par
{\uldb Pattern Intro}{\v Pattern_Intro}\tab An introduction to pattern rules.\par
{\uldb Pattern Examples}{\v Pattern_Examples}\tab Examples of pattern rules.\par
{\uldb Automatic}{\v Automatic}\tab How to use automatic variables in the commands of implicit rules.\par
{\uldb Pattern Match}{\v Pattern_Match}\tab How patterns match.\par
{\uldb Match-Anything Rules}{\v Match_Anything_Rules}\tab Precautions you should take prior to defining rules that can match any target file whatever.\par
{\uldb Canceling Rules}{\v Canceling_Rules}\tab How to override or cancel built-in rules.\par
\par
  Using {\f1{}make} to Update Archive Files\par
\par
 \par
{\uldb Archive Members}{\v Archive_Members}\tab Archive members as targets.\par
{\uldb Archive Update}{\v Archive_Update}\tab The implicit rule for archive member targets.\par
{\uldb Archive Pitfalls}{\v Archive_Pitfalls}\tab Dangers to watch out for when using archives.\par
{\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}\tab You can write a special kind of suffix rule for updating archives.\par
\par
  Implicit Rule for Archive Member Targets\par
\par
 \par
{\uldb Archive Symbols}{\v Archive_Symbols}\tab How to update archive symbol directories.\par
\pard{}}\par
\page\pard Node: {\b Overview}, \keepn Next: {\uldb Introduction}{\v Introduction}, Prev: {\uldb Top}{\v Top}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Overview}
#{\footnote Overview}
${\footnote \pard{}Overview of {\f1{}make}}\par
\pard{\fs24\b Overview of {\f1{}make}}\par
\par
\pard{}The {\f1{}make} utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them.  This manual describes GNU {\f1{}make}, which was implemented by Richard Stallman and Roland McGrath.  Development since Version 3.76 has been handled by Paul D. Smith.\par
\par
\pard{}GNU {\f1{}make} conforms to section 6.2 of {\i IEEE Standard 1003.2-1992} (POSIX.2).  {K{\footnote K POSIX}}{K{\footnote K IEEE Standard 1003.2}}{K{\footnote K standards conformance}} Our examples show C programs, since they are most common, but you can use {\f1{}make} with any programming language whose compiler can be run with a shell command.  Indeed, {\f1{}make} is not limited to programs.  You can use it to describe any task where some files must be updated automatically from others whenever the others change.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Preparing}{\v Preparing}\tab Preparing and Running Make\par
{\uldb Reading}{\v Reading}\tab On Reading this Text\par
{\uldb Bugs}{\v Bugs}\tab Problems and Bugs\par
\pard{}}\par
\page\pard Node: {\b Preparing}, \keepn Next: {\uldb Reading}{\v Reading}, Prev: {\uldb }{\v }, Up: {\uldb Overview}{\v Overview}\line
K{\footnote K Preparing}
#{\footnote Preparing}
{${\footnote \pard{}Preparing and Running Make}\par
\pard{\fs24\b Preparing and Running Make}\par
\par
}\pard{}To prepare to use {\f1{}make}, you must write a file called the \'A2makefile\'A2 that describes the relationships among files in your program and provides commands for updating each file.  In a program, typically, the executable file is updated from object files, which are in turn made by compiling source files.\par
\par
\pard{}Once a suitable makefile exists, each time you change some source files, this simple shell command:\par
\par
{\pard\keep\li720\f1{}make\par
\pard\f0{}}\par
\pard{}suffices to perform all necessary recompilations.  The {\f1{}make} program uses the makefile data base and the last-modification times of the files to decide which of the files need to be updated.  For each of those files, it issues the commands recorded in the data base.\par
\par
\pard{}You can provide command line arguments to {\f1{}make} to control which files should be recompiled, or how.  See {\uldb How to Run\'5Cline {\f1{}make}}{\v Running}.\par
\par
\page\pard Node: {\b Reading}, \keepn Next: {\uldb Bugs}{\v Bugs}, Prev: {\uldb Preparing}{\v Preparing}, Up: {\uldb Overview}{\v Overview}\line
K{\footnote K Reading}
#{\footnote Reading}
${\footnote \pard{}How to Read This Manual}\par
\pard{\fs24\b How to Read This Manual}\par
\par
\pard{}If you are new to {\f1{}make}, or are looking for a general introduction, read the first few sections of each chapter, skipping the later sections.  In each chapter, the first few sections contain introductory or general information and the later sections contain specialized or technical information.  {The exception is the second chapter, {\uldb An Introduction to Makefiles}{\v Introduction}, all of which is introductory.  }\par
\par
\pard{}If you are familiar with other {\f1{}make} programs, see {\uldb \'5Cline}{\v Features}, which lists the enhancements GNU {\f1{}make} has, and {\uldb Incompatibilities and Missing Features}{\v Missing}, which explains the few things GNU {\f1{}make} lacks that others have.\par
\par
\pard{}For a quick summary, see {\uldb Options Summary}{\v Options_Summary}, {\uldb Quick Reference}{\v Quick_Reference}, and {\uldb Special Targets}{\v Special_Targets}.\par
\par
\page\pard Node: {\b Bugs}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Reading}{\v Reading}, Up: {\uldb Overview}{\v Overview}\line
K{\footnote K Bugs}
#{\footnote Bugs}
${\footnote \pard{}Problems and Bugs}\par
\pard{\fs24\b Problems and Bugs}\par
\par
\pard{}{K{\footnote K reporting bugs}}{K{\footnote K bugs, reporting}}{K{\footnote K problems and bugs, reporting}} If you have problems with GNU {\f1{}make} or think you've found a bug, please report it to the developers; we cannot promise to do anything but we might well want to fix it.\par
\par
\pard{}Before reporting a bug, make sure you've actually found a real bug.  Carefully reread the documentation and see if it really says you can do what you're trying to do.  If it's not clear whether you should be able to do something or not, report that too; it's a bug in the documentation!\par
\par
\pard{}Before reporting a bug or trying to fix it yourself, try to isolate it to the smallest possible makefile that reproduces the problem.  Then send us the makefile and the exact results {\f1{}make} gave you.  Also say what you expected to occur; this will help us decide whether the problem was really in the documentation.\par
\par
\pard{}Once you've got a precise problem, please send electronic mail to:\par
\par
{\pard\keep\li720\f1{}    bug-make@gnu.org\par
\pard\f0{}}\par
\pard{}Please include the version number of {\f1{}make} you are using.  You can get this information with the command {\f1{}make --version}.  Be sure also to include the type of machine and operating system you are using.  If possible, include the contents of the file {\f1{}config.h} that is generated by the configuration process.\par
\par
\page\pard Node: {\b Introduction}, \keepn Next: {\uldb Makefiles}{\v Makefiles}, Prev: {\uldb Overview}{\v Overview}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Introduction}
#{\footnote Introduction}
${\footnote \pard{}An Introduction to Makefiles}\par
\pard{\fs24\b An Introduction to Makefiles}\par
\par
\pard{}You need a file called a \'A2makefile\'A2 to tell {\f1{}make} what to do.  Most often, the makefile tells {\f1{}make} how to compile and link a program.  {K{\footnote K makefile}} In this chapter, we will discuss a simple makefile that describes how to compile and link a text editor which consists of eight C source files and three header files.  The makefile can also tell {\f1{}make} how to run miscellaneous commands when explicitly asked (for example, to remove certain files as a clean-up operation).  To see a more complex example of a makefile, see {\uldb Complex Makefile}{\v Complex_Makefile}.\par
\par
\pard{}When {\f1{}make} recompiles the editor, each changed C source file must be recompiled.  If a header file has changed, each C source file that includes the header file must be recompiled to be safe.  Each compilation produces an object file corresponding to the source file.  Finally, if any source file has been recompiled, all the object files, whether newly made or saved from previous compilations, must be linked together to produce the new executable editor.  {K{\footnote K recompilation}}{K{\footnote K editor}} {\par
\par
\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Rule Introduction}{\v Rule_Introduction}\tab What a rule looks like.\par
{\uldb Simple Makefile}{\v Simple_Makefile}\tab A Simple Makefile\par
{\uldb How Make Works}{\v How_Make_Works}\tab How {\f1{}make} Processes This Makefile\par
{\uldb Variables Simplify}{\v Variables_Simplify}\tab Variables Make Makefiles Simpler\par
{\uldb make Deduces}{\v make_Deduces}\tab Letting {\f1{}make} Deduce the Commands\par
{\uldb Combine By Prerequisite}{\v Combine_By_Prerequisite}\tab Another Style of Makefile\par
{\uldb Cleanup}{\v Cleanup}\tab Rules for Cleaning the Directory\par
\pard{}}\par
\page\pard Node: {\b Rule Introduction}, \keepn Next: {\uldb Simple Makefile}{\v Simple_Makefile}, Prev: {\uldb }{\v }, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K Rule Introduction}
#{\footnote Rule_Introduction}
${\footnote \pard{}What a Rule Looks Like}\par
\pard{\fs24\b What a Rule Looks Like}\par
\par
\pard{}{K{\footnote K rule, introduction to}}{K{\footnote K makefile rule parts}}{K{\footnote K parts of makefile rule}} A simple makefile consists of "rules" with the following shape:\par
\par
\pard{}{K{\footnote K targets, introduction to}}{K{\footnote K prerequisites, introduction to}}{K{\footnote K commands, introduction to}}{\par
{{\i \pard\li720\f1{}target} ... : {\i prerequisites} ...\line
        {\i command}\line
        ...\line
        ...\par
\pard\keep\li720{}}}\par
\pard\f0{}A \'A2target\'A2 is usually the name of a file that is generated by a program; examples of targets are executable or object files.  A target can also be the name of an action to carry out, such as {\f1{}clean} (see {\uldb Phony Targets}{\v Phony_Targets}).\par
\par
\pard{}A \'A2prerequisite\'A2 is a file that is used as input to create the target.  A target often depends on several files.\par
\par
\pard{}{K{\footnote K tabs in rules}}A \'A2command\'A2 is an action that {\f1{}make} carries out.  A rule may have more than one command, each on its own line.  {\b Please note:} you need to put a tab character at the beginning of every command line!  This is an obscurity that catches the unwary.\par
\par
\pard{}Usually a command is in a rule with prerequisites and serves to create a target file if any of the prerequisites change.  However, the rule that specifies commands for the target need not have prerequisites.  For example, the rule containing the delete command associated with the target {\f1{}clean} does not have prerequisites.\par
\par
\pard{}A \'A2rule\'A2, then, explains how and when to remake certain files which are the targets of the particular rule.  {\f1{}make} carries out the commands on the prerequisites to create or update the target.  A rule can also explain how and when to carry out an action.  See {\uldb Writing Rules}{\v Rules}.\par
\par
\pard{}A makefile may contain other text besides rules, but a simple makefile need only contain rules.  Rules may look somewhat more complicated than shown in this template, but all fit the pattern more or less.\par
\par
\page\pard Node: {\b Simple Makefile}, \keepn Next: {\uldb How Make Works}{\v How_Make_Works}, Prev: {\uldb Rule Introduction}{\v Rule_Introduction}, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K Simple Makefile}
#{\footnote Simple_Makefile}
${\footnote \pard{}A Simple Makefile}\par
\pard{\fs24\b A Simple Makefile}\par
\par
\pard{}{K{\footnote K simple makefile}}{K{\footnote K makefile, simple}} Here is a straightforward makefile that describes the way an executable file called {\f1{}edit} depends on eight object files which, in turn, depend on eight C source and three header files.\par
\par
\pard{}In this example, all the C files include {\f1{}defs.h}, but only those defining editing commands include {\f1{}command.h}, and only low level files that change the editor buffer include {\f1{}buffer.h}.\par
\par
{{\pard\keep\li720\f1{}edit : main.o kbd.o command.o display.o \'5C\line
       insert.o search.o files.o utils.o\line
        cc -o edit main.o kbd.o command.o display.o \'5C\line
                   insert.o search.o files.o utils.o\line
\line
main.o : main.c defs.h\line
        cc -c main.c\line
kbd.o : kbd.c defs.h command.h\line
        cc -c kbd.c\line
command.o : command.c defs.h command.h\line
        cc -c command.c\line
display.o : display.c defs.h buffer.h\line
        cc -c display.c\line
insert.o : insert.c defs.h buffer.h\line
        cc -c insert.c\line
search.o : search.c defs.h buffer.h\line
        cc -c search.c\line
files.o : files.c defs.h buffer.h command.h\line
        cc -c files.c\line
utils.o : utils.c defs.h\line
        cc -c utils.c\line
clean :\line
        rm edit main.o kbd.o command.o display.o \'5C\line
           insert.o search.o files.o utils.o\par
\pard\keep\li720{}}}\par
\pard\f0{}We split each long line into two lines using backslash-newline; this is like using one long line, but is easier to read.  {K{\footnote K continuation lines}}{K{\footnote K {\f1{}\'5C} (backslash), for continuation lines}}{K{\footnote K backslash ({\f1{}\'5C}), for continuation lines}}{K{\footnote K quoting newline, in makefile}}{K{\footnote K newline, quoting, in makefile}} To use this makefile to create the executable file called {\f1{}edit}, type:\par
\par
{\pard\keep\li720\f1{}make\par
\pard\f0{}}\par
\pard{}To use this makefile to delete the executable file and all the object files from the directory, type:\par
\par
{\pard\keep\li720\f1{}make clean\par
\pard\f0{}}\par
\pard{}In the example makefile, the targets include the executable file {\f1{}edit}, and the object files {\f1{}main.o} and {\f1{}kbd.o}.  The prerequisites are files such as {\f1{}main.c} and {\f1{}defs.h}.  In fact, each {\f1{}.o} file is both a target and a prerequisite.  Commands include {\f1{}cc -c main.c} and {\f1{}cc -c kbd.c}.\par
\par
\pard{}When a target is a file, it needs to be recompiled or relinked if any of its prerequisites change.  In addition, any prerequisites that are themselves automatically generated should be updated first.  In this example, {\f1{}edit} depends on each of the eight object files; the object file {\f1{}main.o} depends on the source file {\f1{}main.c} and on the header file {\f1{}defs.h}.\par
\par
\pard{}A shell command follows each line that contains a target and prerequisites.  These shell commands say how to update the target file.  A tab character must come at the beginning of every command line to distinguish commands lines from other lines in the makefile.  (Bear in mind that {\f1{}make} does not know anything about how the commands work.  It is up to you to supply commands that will update the target file properly.  All {\f1{}make} does is execute the commands in the rule you have specified when the target file needs to be updated.)  {K{\footnote K shell command}} The target {\f1{}clean} is not a file, but merely the name of an action.  Since you normally do not want to carry out the actions in this rule, {\f1{}clean} is not a prerequisite of any other rule.  Consequently, {\f1{}make} never does anything with it unless you tell it specifically.  Note that this rule not only is not a prerequisite, it also does not have any prerequisites, so the only purpose of the rule is to run the specified commands.  Targets that do not refer to files but are just actions are called \'A2phony targets\'A2.  See {\uldb Phony Targets}{\v Phony_Targets}, for information about this kind of target.  See {\uldb Errors in Commands}{\v Errors}, to see how to cause {\f1{}make} to ignore errors from {\f1{}rm} or any other command.  {K{\footnote K {\f1{}clean} target}}{K{\footnote K {\f1{}rm} (shell command)}}\par
\par
\page\pard Node: {\b How Make Works}, \keepn Next: {\uldb Variables Simplify}{\v Variables_Simplify}, Prev: {\uldb Simple Makefile}{\v Simple_Makefile}, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K How Make Works}
#{\footnote How_Make_Works}
${\footnote \pard{}How {\f1{}make} Processes a Makefile}\par
\pard{\fs24\b How {\f1{}make} Processes a Makefile}\par
\par
\pard{}{K{\footnote K processing a makefile}}{K{\footnote K makefile, how {\f1{}make} processes}} By default, {\f1{}make} starts with the first target (not targets whose names start with {\f1{}.}).  This is called the \'A2default goal\'A2.  (\'A2Goals\'A2 are the targets that {\f1{}make} strives ultimately to update.  See {\uldb Arguments to Specify the Goals}{\v Goals}.)  {K{\footnote K default goal}}{K{\footnote K goal, default}}{K{\footnote K goal}} In the simple example of the previous section, the default goal is to update the executable program {\f1{}edit}; therefore, we put that rule first.\par
\par
\pard{}Thus, when you give the command:\par
\par
{\pard\keep\li720\f1{}make\par
\pard\f0{}}\par
{\f1{}\pard{}make} reads the makefile in the current directory and begins by processing the first rule.  In the example, this rule is for relinking {\f1{}edit}; but before {\f1{}make} can fully process this rule, it must process the rules for the files that {\f1{}edit} depends on, which in this case are the object files.  Each of these files is processed according to its own rule.  These rules say to update each {\f1{}.o} file by compiling its source file.  The recompilation must be done if the source file, or any of the header files named as prerequisites, is more recent than the object file, or if the object file does not exist.\par
\par
\pard{}The other rules are processed because their targets appear as prerequisites of the goal.  If some other rule is not depended on by the goal (or anything it depends on, etc.), that rule is not processed, unless you tell {\f1{}make} to do so (with a command such as {\f1{}make clean}).\par
\par
\pard{}Before recompiling an object file, {\f1{}make} considers updating its prerequisites, the source file and header files.  This makefile does not specify anything to be done for them--the {\f1{}.c} and {\f1{}.h} files are not the targets of any rules--so {\f1{}make} does nothing for these files.  But {\f1{}make} would update automatically generated C programs, such as those made by Bison or Yacc, by their own rules at this time.\par
\par
\pard{}After recompiling whichever object files need it, {\f1{}make} decides whether to relink {\f1{}edit}.  This must be done if the file {\f1{}edit} does not exist, or if any of the object files are newer than it.  If an object file was just recompiled, it is now newer than {\f1{}edit}, so {\f1{}edit} is relinked.  {K{\footnote K relinking}} Thus, if we change the file {\f1{}insert.c} and run {\f1{}make}, {\f1{}make} will compile that file to update {\f1{}insert.o}, and then link {\f1{}edit}.  If we change the file {\f1{}command.h} and run {\f1{}make}, {\f1{}make} will recompile the object files {\f1{}kbd.o}, {\f1{}command.o} and {\f1{}files.o} and then link the file {\f1{}edit}.\par
\par
\page\pard Node: {\b Variables Simplify}, \keepn Next: {\uldb make Deduces}{\v make_Deduces}, Prev: {\uldb How Make Works}{\v How_Make_Works}, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K Variables Simplify}
#{\footnote Variables_Simplify}
${\footnote \pard{}Variables Make Makefiles Simpler}\par
\pard{\fs24\b Variables Make Makefiles Simpler}\par
\par
\pard{}{K{\footnote K variables}}{K{\footnote K simplifying with variables}} In our example, we had to list all the object files twice in the rule for {\f1{}edit} (repeated here):\par
\par
{{\pard\keep\li720\f1{}edit : main.o kbd.o command.o display.o \'5C\line
              insert.o search.o files.o utils.o\line
        cc -o edit main.o kbd.o command.o display.o \'5C\line
                   insert.o search.o files.o utils.o\par
\pard\keep\li720{}}}\par
\pard\f0{}{K{\footnote K {\f1{}objects}}}Such duplication is error-prone; if a new object file is added to the system, we might add it to one list and forget the other.  We can eliminate the risk and simplify the makefile by using a variable.  \'A2Variables\'A2 allow a text string to be defined once and substituted in multiple places later (see {\uldb How to Use Variables}{\v Using_Variables}).\par
\par
\pard{}{K{\footnote K {\f1{}OBJECTS}}}{K{\footnote K {\f1{}objs}}}{K{\footnote K {\f1{}OBJS}}}{K{\footnote K {\f1{}obj}}}{K{\footnote K {\f1{}OBJ}}}It is standard practice for every makefile to have a variable named {\f1{}objects}, {\f1{}OBJECTS}, {\f1{}objs}, {\f1{}OBJS}, {\f1{}obj}, or {\f1{}OBJ} which is a list of all object file names.  We would define such a variable {\f1{}objects} with a line like this in the makefile:\par
\par
{{\pard\keep\li720\f1{}objects = main.o kbd.o command.o display.o \'5C\line
          insert.o search.o files.o utils.o\par
\pard\keep\li720{}}}\par
\pard\f0{}Then, each place we want to put a list of the object file names, we can substitute the variable's value by writing {\f1{}$(objects)} (see {\uldb How to Use Variables}{\v Using_Variables}).\par
\par
\pard{}Here is how the complete simple makefile looks when you use a variable for the object files:\par
\par
{{\pard\keep\li720\f1{}objects = main.o kbd.o command.o display.o \'5C\line
          insert.o search.o files.o utils.o\line
\line
edit : $(objects)\line
        cc -o edit $(objects)\line
main.o : main.c defs.h\line
        cc -c main.c\line
kbd.o : kbd.c defs.h command.h\line
        cc -c kbd.c\line
command.o : command.c defs.h command.h\line
        cc -c command.c\line
display.o : display.c defs.h buffer.h\line
        cc -c display.c\line
insert.o : insert.c defs.h buffer.h\line
        cc -c insert.c\line
search.o : search.c defs.h buffer.h\line
        cc -c search.c\line
files.o : files.c defs.h buffer.h command.h\line
        cc -c files.c\line
utils.o : utils.c defs.h\line
        cc -c utils.c\line
clean :\line
        rm edit $(objects)\par
\pard\keep\li720{}}}\par
\page\pard Node: {\b make Deduces}, \keepn Next: {\uldb Combine By Prerequisite}{\v Combine_By_Prerequisite}, Prev: {\uldb Variables Simplify}{\v Variables_Simplify}, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K make Deduces}
#{\footnote make_Deduces}
${\footnote \pard\f0{}Letting {\f1{}make} Deduce the Commands}\par
\pard{\fs24\b Letting {\f1{}make} Deduce the Commands}\par
\par
\pard{}{K{\footnote K deducing commands (implicit rules)}}{K{\footnote K implicit rule, introduction to}}{K{\footnote K rule, implicit, introduction to}} It is not necessary to spell out the commands for compiling the individual C source files, because {\f1{}make} can figure them out: it has an \'A2implicit rule\'A2 for updating a {\f1{}.o} file from a correspondingly named {\f1{}.c} file using a {\f1{}cc -c} command.  For example, it will use the command {\f1{}cc -c main.c -o main.o} to compile {\f1{}main.c} into {\f1{}main.o}.  We can therefore omit the commands from the rules for the object files.  See {\uldb Using Implicit Rules}{\v Implicit_Rules}.\par
\par
\pard{}When a {\f1{}.c} file is used automatically in this way, it is also automatically added to the list of prerequisites.  We can therefore omit the {\f1{}.c} files from the prerequisites, provided we omit the commands.\par
\par
\pard{}Here is the entire example, with both of these changes, and a variable {\f1{}objects} as suggested above:\par
\par
{{\pard\keep\li720\f1{}objects = main.o kbd.o command.o display.o \'5C\line
          insert.o search.o files.o utils.o\line
\line
edit : $(objects)\line
        cc -o edit $(objects)\line
\line
main.o : defs.h\line
kbd.o : defs.h command.h\line
command.o : defs.h command.h\line
display.o : defs.h buffer.h\line
insert.o : defs.h buffer.h\line
search.o : defs.h buffer.h\line
files.o : defs.h buffer.h command.h\line
utils.o : defs.h\line
\line
.PHONY : clean\line
clean :\line
        -rm edit $(objects)\par
\pard\keep\li720{}}}\par
\pard\f0{}This is how we would write the makefile in actual practice.  (The complications associated with {\f1{}clean} are described elsewhere.  See {\uldb Phony Targets}{\v Phony_Targets}, and {\uldb Errors in Commands}{\v Errors}.)\par
\par
\pard{}Because implicit rules are so convenient, they are important.  You will see them used frequently.\par
\par
\page\pard Node: {\b Combine By Prerequisite}, \keepn Next: {\uldb Cleanup}{\v Cleanup}, Prev: {\uldb make Deduces}{\v make_Deduces}, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K Combine By Prerequisite}
#{\footnote Combine_By_Prerequisite}
${\footnote \pard{}Another Style of Makefile}\par
\pard{\fs24\b Another Style of Makefile}\par
\par
\pard{}{K{\footnote K combining rules by prerequisite}} When the objects of a makefile are created only by implicit rules, an alternative style of makefile is possible.  In this style of makefile, you group entries by their prerequisites instead of by their targets.  Here is what one looks like:\par
\par
{{\pard\keep\li720\f1{}objects = main.o kbd.o command.o display.o \'5C\line
          insert.o search.o files.o utils.o\line
\line
edit : $(objects)\line
        cc -o edit $(objects)\line
\line
$(objects) : defs.h\line
kbd.o command.o files.o : command.h\line
display.o insert.o search.o files.o : buffer.h\par
\pard\keep\li720{}}}\par
\pard\f0{}Here {\f1{}defs.h} is given as a prerequisite of all the object files; {\f1{}command.h} and {\f1{}buffer.h} are prerequisites of the specific object files listed for them.\par
\par
\pard{}Whether this is better is a matter of taste: it is more compact, but some people dislike it because they find it clearer to put all the information about each target in one place.\par
\par
\page\pard Node: {\b Cleanup}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Combine By Prerequisite}{\v Combine_By_Prerequisite}, Up: {\uldb Introduction}{\v Introduction}\line
K{\footnote K Cleanup}
#{\footnote Cleanup}
${\footnote \pard{}Rules for Cleaning the Directory}\par
\pard{\fs24\b Rules for Cleaning the Directory}\par
\par
\pard{}{K{\footnote K cleaning up}}{K{\footnote K removing, to clean up}} Compiling a program is not the only thing you might want to write rules for.  Makefiles commonly tell how to do a few other things besides compiling a program: for example, how to delete all the object files and executables so that the directory is {\f1{}clean}.\par
\par
\pard{}{K{\footnote K {\f1{}clean} target}}Here is how we could write a {\f1{}make} rule for cleaning our example editor:\par
\par
{{\pard\keep\li720\f1{}clean:\line
        rm edit $(objects)\par
\pard\keep\li720{}}}\par
\pard\f0{}In practice, we might want to write the rule in a somewhat more complicated manner to handle unanticipated situations.  We would do this:\par
\par
{{\pard\keep\li720\f1{}.PHONY : clean\line
clean :\line
        -rm edit $(objects)\par
\pard\keep\li720{}}}\par
\pard\f0{}This prevents {\f1{}make} from getting confused by an actual file called {\f1{}clean} and causes it to continue in spite of errors from {\f1{}rm}.  (See {\uldb Phony Targets}{\v Phony_Targets}, and {\uldb Errors in Commands}{\v Errors}.)\par
\par
\pard{}A rule such as this should not be placed at the beginning of the makefile, because we do not want it to run by default!  Thus, in the example makefile, we want the rule for {\f1{}edit}, which recompiles the editor, to remain the default goal.\par
\par
\pard{}Since {\f1{}clean} is not a prerequisite of {\f1{}edit}, this rule will not run at all if we give the command {\f1{}make} with no arguments.  In order to make the rule run, we have to type {\f1{}make clean}.  See {\uldb How to Run {\f1{}make}}{\v Running}.\par
\par
\page\pard Node: {\b Makefiles}, \keepn Next: {\uldb Rules}{\v Rules}, Prev: {\uldb Introduction}{\v Introduction}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Makefiles}
#{\footnote Makefiles}
${\footnote \pard{}Writing Makefiles}\par
\pard{\fs24\b Writing Makefiles}\par
\par
\pard{}{K{\footnote K makefile, how to write}}The information that tells {\f1{}make} how to recompile a system comes from reading a data base called the \'A2makefile\'A2.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Makefile Contents}{\v Makefile_Contents}\tab What makefiles contain.\par
{\uldb Makefile Names}{\v Makefile_Names}\tab How to name your makefile.\par
{\uldb Include}{\v Include}\tab How one makefile can use another makefile.\par
{\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}\tab The environment can specify extra makefiles.\par
{\uldb Remaking Makefiles}{\v Remaking_Makefiles}\tab How makefiles get remade.\par
{\uldb Overriding Makefiles}{\v Overriding_Makefiles}\tab How to override part of one makefile with another makefile.\par
{\uldb Reading Makefiles}{\v Reading_Makefiles}\tab How makefiles are parsed.\par
\pard{}}\par
\page\pard Node: {\b Makefile Contents}, \keepn Next: {\uldb Makefile Names}{\v Makefile_Names}, Prev: {\uldb }{\v }, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K Makefile Contents}
#{\footnote Makefile_Contents}
${\footnote \pard{}What Makefiles Contain}\par
\pard{\fs24\b What Makefiles Contain}\par
\par
\pard{}Makefiles contain five kinds of things: \'A2explicit rules\'A2, \'A2implicit rules\'A2, \'A2variable definitions\'A2, \'A2directives\'A2, and \'A2comments\'A2.  Rules, variables, and directives are described at length in later chapters.\par
\par
{\pard\li720{}{K{\footnote K rule, explicit, definition of}}{K{\footnote K explicit rule, definition of}}\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}An \'A2explicit rule\'A2 says when and how to remake one or more files, called the rule's targets.  It lists the other files that the targets depend on, call the \'A2prerequisites\'A2 of the target, and may also give commands to use to create or update the targets.  See {\uldb Writing Rules}{\v Rules}.\par
\par
\pard\li720{}{K{\footnote K rule, implicit, definition of}}{K{\footnote K implicit rule, definition of}}\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}An \'A2implicit rule\'A2 says when and how to remake a class of files based on their names.  It describes how a target may depend on a file with a name similar to the target and gives commands to create or update such a target.  See {\uldb Using Implicit Rules}{\v Implicit_Rules}.\par
\par
\pard\li720{}{K{\footnote K variable definition}}\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}A \'A2variable definition\'A2 is a line that specifies a text string value for a variable that can be substituted into the text later.  The simple makefile example shows a variable definition for {\f1{}objects} as a list of all object files (see {\uldb Variables Make Makefiles Simpler}{\v Variables_Simplify}).\par
\par
\pard\li720{}{K{\footnote K directive}}\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}A \'A2directive\'A2 is a command for {\f1{}make} to do something special while reading the makefile.  These include:\par
\par
{\pard\fi-720\li1440\tx864\tx1440{}\tab{}{\f2\'B7}\tab{}Reading another makefile (see {\uldb Including Other Makefiles}{\v Include}).\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}{\f2\'B7}\tab{}Deciding (based on the values of variables) whether to use or ignore a part of the makefile (see {\uldb Conditional Parts of Makefiles}{\v Conditionals}).\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}{\f2\'B7}\tab{}Defining a variable from a verbatim string containing multiple lines (see {\uldb Defining Variables Verbatim}{\v Defining}).\par
\pard\li720{}}\par
\pard\li720{}{K{\footnote K comments, in makefile}}{K{\footnote K {\f1{}#} (comments), in makefile}}\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}{\f1{}#} in a line of a makefile starts a \'A2comment\'A2.  It and the rest of the line are ignored, except that a trailing backslash not escaped by another backslash will continue the comment across multiple lines.  Comments may appear on any of the lines in the makefile, except within a {\f1{}define} directive, and perhaps within commands (where the shell decides what is a comment).  A line containing just a comment (with perhaps spaces before it) is effectively blank, and is ignored.\par
\pard{}}\par
\page\pard Node: {\b Makefile Names}, \keepn Next: {\uldb Include}{\v Include}, Prev: {\uldb Makefile Contents}{\v Makefile_Contents}, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K Makefile Names}
#{\footnote Makefile_Names}
${\footnote \pard{}What Name to Give Your Makefile}\par
\pard{\fs24\b What Name to Give Your Makefile}\par
\par
\pard{}{K{\footnote K makefile name}}{K{\footnote K name of makefile}}{K{\footnote K default makefile name}}{K{\footnote K file name of makefile}} By default, when {\f1{}make} looks for the makefile, it tries the following names, in order: {\f1{}GNUmakefile}, {\f1{}makefile} and {\f1{}Makefile}.  {K{\footnote K Makefile}}{K{\footnote K GNUmakefile}}{K{\footnote K makefile}} {K{\footnote K {\f1{}README}}}Normally you should call your makefile either {\f1{}makefile} or {\f1{}Makefile}.  (We recommend {\f1{}Makefile} because it appears prominently near the beginning of a directory listing, right near other important files such as {\f1{}README}.)  The first name checked, {\f1{}GNUmakefile}, is not recommended for most makefiles.  You should use this name if you have a makefile that is specific to GNU {\f1{}make}, and will not be understood by other versions of {\f1{}make}.  Other {\f1{}make} programs look for {\f1{}makefile} and {\f1{}Makefile}, but not {\f1{}GNUmakefile}.\par
\par
\pard{}If {\f1{}make} finds none of these names, it does not use any makefile.  Then you must specify a goal with a command argument, and {\f1{}make} will attempt to figure out how to remake it using only its built-in implicit rules.  See {\uldb Using Implicit Rules}{\v Implicit_Rules}.\par
\par
\pard{}{K{\footnote K {\f1{}-f}}}{K{\footnote K {\f1{}--file}}}{K{\footnote K {\f1{}--makefile}}}If you want to use a nonstandard name for your makefile, you can specify the makefile name with the {\f1{}-f} or {\f1{}--file} option.  The arguments {\f1{}-f {\i name}} or {\f1{}--file={\i name}} tell {\f1{}make} to read the file {\i name} as the makefile.  If you use more than one {\f1{}-f} or {\f1{}--file} option, you can specify several makefiles.  All the makefiles are effectively concatenated in the order specified.  The default makefile names {\f1{}GNUmakefile}, {\f1{}makefile} and {\f1{}Makefile} are not checked automatically if you specify {\f1{}-f} or {\f1{}--file}.  {K{\footnote K specifying makefile name}}{K{\footnote K makefile name, how to specify}}{K{\footnote K name of makefile, how to specify}}{K{\footnote K file name of makefile, how to specify}}\par
\par
\page\pard Node: {\b Include}, \keepn Next: {\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}, Prev: {\uldb Makefile Names}{\v Makefile_Names}, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K Include}
#{\footnote Include}
${\footnote \pard{}Including Other Makefiles}\par
\pard{\fs24\b Including Other Makefiles}\par
\par
\pard{}{K{\footnote K including other makefiles}}{K{\footnote K makefile, including}} {K{\footnote K include}}The {\f1{}include} directive tells {\f1{}make} to suspend reading the current makefile and read one or more other makefiles before continuing.  The directive is a line in the makefile that looks like this:\par
\par
{\pard\keep\li720\f1{}include {\i filenames}...\par
\pard\f0{}}\par
{\i \pard{}filenames} can contain shell file name patterns.  {K{\footnote K shell file name pattern (in {\f1{}include})}}{K{\footnote K shell wildcards (in {\f1{}include})}}{K{\footnote K wildcard, in {\f1{}include}}} Extra spaces are allowed and ignored at the beginning of the line, but a tab is not allowed.  (If the line begins with a tab, it will be considered a command line.)  Whitespace is required between {\f1{}include} and the file names, and between file names; extra whitespace is ignored there and at the end of the directive.  A comment starting with {\f1{}#} is allowed at the end of the line.  If the file names contain any variable or function references, they are expanded.  See {\uldb How to Use Variables}{\v Using_Variables}.\par
\par
\pard{}For example, if you have three {\f1{}.mk} files, {\f1{}a.mk}, {\f1{}b.mk}, and {\f1{}c.mk}, and {\f1{}$(bar)} expands to {\f1{}bish bash}, then the following expression\par
\par
{\pard\keep\li720\f1{}include foo *.mk $(bar)\par
\pard\f0{}}\par
\pard{}is equivalent to\par
\par
{\pard\keep\li720\f1{}include foo a.mk b.mk c.mk bish bash\par
\pard\f0{}}\par
\pard{}When {\f1{}make} processes an {\f1{}include} directive, it suspends reading of the containing makefile and reads from each listed file in turn.  When that is finished, {\f1{}make} resumes reading the makefile in which the directive appears.\par
\par
\pard{}One occasion for using {\f1{}include} directives is when several programs, handled by individual makefiles in various directories, need to use a common set of variable definitions (see {\uldb Setting Variables}{\v Setting}) or pattern rules (see {\uldb Defining and Redefining Pattern Rules}{\v Pattern_Rules}).\par
\par
\pard{}Another such occasion is when you want to generate prerequisites from source files automatically; the prerequisites can be put in a file that is included by the main makefile.  This practice is generally cleaner than that of somehow appending the prerequisites to the end of the main makefile as has been traditionally done with other versions of {\f1{}make}.  See {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.  {K{\footnote K prerequisites, automatic generation}}{K{\footnote K automatic generation of prerequisites}}{K{\footnote K generating prerequisites automatically}} {K{\footnote K {\f1{}-I}}}{K{\footnote K {\f1{}--include-dir}}}{K{\footnote K included makefiles, default directries}}{K{\footnote K default directries for included makefiles}}{K{\footnote K /usr/gnu/include}}{K{\footnote K /usr/local/include}}{K{\footnote K /usr/include}}If the specified name does not start with a slash, and the file is not found in the current directory, several other directories are searched.  First, any directories you have specified with the {\f1{}-I} or {\f1{}--include-dir} option are searched (see {\uldb Summary of Options}{\v Options_Summary}).  Then the following directories (if they exist) are searched, in this order: {\f1{}{\i prefix}/include} (normally {\f1{}/usr/local/include} ({\ul 1}{\v Include_1})) {\f1{}/usr/gnu/include}, {\f1{}/usr/local/include}, {\f1{}/usr/include}.\par
\par
\pard{}If an included makefile cannot be found in any of these directories, a warning message is generated, but it is not an immediately fatal error; processing of the makefile containing the {\f1{}include} continues.  Once it has finished reading makefiles, {\f1{}make} will try to remake any that are out of date or don't exist.  See {\uldb How Makefiles Are Remade}{\v Remaking_Makefiles}.  Only after it has tried to find a way to remake a makefile and failed, will {\f1{}make} diagnose the missing makefile as a fatal error.\par
\par
\pard{}If you want {\f1{}make} to simply ignore a makefile which does not exist and cannot be remade, with no error message, use the {\f1{}-include} directive instead of {\f1{}include}, like this:\par
\par
{\pard\keep\li720\f1{}-include {\i filenames}...\par
\pard\f0{}}\par
\pard{}This is acts like {\f1{}include} in every way except that there is no error (not even a warning) if any of the {\i filenames} do not exist.  For compatibility with some other {\f1{}make} implementations, {\f1{}sinclude} is another name for {\f1{}-include}.\par
\par
\page\pard#{\footnote Include_1}
\pard{}(1) GNU Make compiled for MS-DOS and MS-Windows behaves as if {\i prefix} has been defined to be the root of the DJGPP tree hierarchy.\par
\par
\page\pard Node: {\b MAKEFILES Variable}, \keepn Next: {\uldb Remaking Makefiles}{\v Remaking_Makefiles}, Prev: {\uldb Include}{\v Include}, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K MAKEFILES Variable}
#{\footnote MAKEFILES_Variable}
${\footnote \pard{}The Variable {\f1{}MAKEFILES}}\par
\pard{\fs24\b The Variable {\f1{}MAKEFILES}}\par
\par
\pard{}{K{\footnote K makefile, and {\f1{}MAKEFILES} variable}}{K{\footnote K including ({\f1{}MAKEFILES} variable)}} {K{\footnote K MAKEFILES}}If the environment variable {\f1{}MAKEFILES} is defined, {\f1{}make} considers its value as a list of names (separated by whitespace) of additional makefiles to be read before the others.  This works much like the {\f1{}include} directive: various directories are searched for those files (see {\uldb Including Other Makefiles}{\v Include}).  In addition, the default goal is never taken from one of these makefiles and it is not an error if the files listed in {\f1{}MAKEFILES} are not found.\par
\par
\pard{}{K{\footnote K recursion, and {\f1{}MAKEFILES} variable}}The main use of {\f1{}MAKEFILES} is in communication between recursive invocations of {\f1{}make} (see {\uldb Recursive Use of\'5Cline {\f1{}make}}{\v Recursion}).  It usually is not desirable to set the environment variable before a top-level invocation of {\f1{}make}, because it is usually better not to mess with a makefile from outside.  However, if you are running {\f1{}make} without a specific makefile, a makefile in {\f1{}MAKEFILES} can do useful things to help the built-in implicit rules work better, such as defining search paths (see {\uldb Directory Search}{\v Directory_Search}).\par
\par
\pard{}Some users are tempted to set {\f1{}MAKEFILES} in the environment automatically on login, and program makefiles to expect this to be done.  This is a very bad idea, because such makefiles will fail to work if run by anyone else.  It is much better to write explicit {\f1{}include} directives in the makefiles.  See {\uldb Including Other Makefiles}{\v Include}.\par
\par
\page\pard Node: {\b Remaking Makefiles}, \keepn Next: {\uldb Overriding Makefiles}{\v Overriding_Makefiles}, Prev: {\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K Remaking Makefiles}
#{\footnote Remaking_Makefiles}
${\footnote \pard{}How Makefiles Are Remade}\par
\pard{\fs24\b How Makefiles Are Remade}\par
\par
\pard{}{K{\footnote K updating makefiles}}{K{\footnote K remaking makefiles}}{K{\footnote K makefile, remaking of}}Sometimes makefiles can be remade from other files, such as RCS or SCCS files.  If a makefile can be remade from other files, you probably want {\f1{}make} to get an up-to-date version of the makefile to read in.\par
\par
\pard{}To this end, after reading in all makefiles, {\f1{}make} will consider each as a goal target and attempt to update it.  If a makefile has a rule which says how to update it (found either in that very makefile or in another one) or if an implicit rule applies to it (see {\uldb Using Implicit Rules}{\v Implicit_Rules}), it will be updated if necessary.  After all makefiles have been checked, if any have actually been changed, {\f1{}make} starts with a clean slate and reads all the makefiles over again.  (It will also attempt to update each of them over again, but normally this will not change them again, since they are already up to date.)\par
\par
\pard{}If you know that one or more of your makefiles cannot be remade and you want to keep {\f1{}make} from performing an implicit rule search on them, perhaps for efficiency reasons, you can use any normal method of preventing implicit rule lookup to do so.  For example, you can write an explicit rule with the makefile as the target, and an empty command string (see {\uldb Using Empty Commands}{\v Empty_Commands}).\par
\par
\pard{}If the makefiles specify a double-colon rule to remake a file with commands but no prerequisites, that file will always be remade (see {\uldb Double-Colon}{\v Double_Colon}).  In the case of makefiles, a makefile that has a double-colon rule with commands but no prerequisites will be remade every time {\f1{}make} is run, and then again after {\f1{}make} starts over and reads the makefiles in again.  This would cause an infinite loop: {\f1{}make} would constantly remake the makefile, and never do anything else.  So, to avoid this, {\f1{}make} will {\b not} attempt to remake makefiles which are specified as targets of a double-colon rule with commands but no prerequisites.\par
\par
\pard{}If you do not specify any makefiles to be read with {\f1{}-f} or {\f1{}--file} options, {\f1{}make} will try the default makefile names; see {\uldb What Name to Give Your Makefile}{\v Makefile_Names}.  Unlike makefiles explicitly requested with {\f1{}-f} or {\f1{}--file} options, {\f1{}make} is not certain that these makefiles should exist.  However, if a default makefile does not exist but can be created by running {\f1{}make} rules, you probably want the rules to be run so that the makefile can be used.\par
\par
\pard{}Therefore, if none of the default makefiles exists, {\f1{}make} will try to make each of them in the same order in which they are searched for (see {\uldb What Name to Give Your Makefile}{\v Makefile_Names}) until it succeeds in making one, or it runs out of names to try.  Note that it is not an error if {\f1{}make} cannot find or make any makefile; a makefile is not always necessary.\par
\par
\pard{}When you use the {\f1{}-t} or {\f1{}--touch} option (see {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}), you would not want to use an out-of-date makefile to decide which targets to touch.  So the {\f1{}-t} option has no effect on updating makefiles; they are really updated even if {\f1{}-t} is specified.  Likewise, {\f1{}-q} (or {\f1{}--question}) and {\f1{}-n} (or {\f1{}--just-print}) do not prevent updating of makefiles, because an out-of-date makefile would result in the wrong output for other targets.  Thus, {\f1{}make -f mfile -n foo} will update {\f1{}mfile}, read it in, and then print the commands to update {\f1{}foo} and its prerequisites without running them.  The commands printed for {\f1{}foo} will be those specified in the updated contents of {\f1{}mfile}.\par
\par
\pard{}However, on occasion you might actually wish to prevent updating of even the makefiles.  You can do this by specifying the makefiles as goals in the command line as well as specifying them as makefiles.  When the makefile name is specified explicitly as a goal, the options {\f1{}-t} and so on do apply to them.\par
\par
\pard{}Thus, {\f1{}make -f mfile -n mfile foo} would read the makefile {\f1{}mfile}, print the commands needed to update it without actually running them, and then print the commands needed to update {\f1{}foo} without running them.  The commands for {\f1{}foo} will be those specified by the existing contents of {\f1{}mfile}.\par
\par
\page\pard Node: {\b Overriding Makefiles}, \keepn Next: {\uldb Reading Makefiles}{\v Reading_Makefiles}, Prev: {\uldb Remaking Makefiles}{\v Remaking_Makefiles}, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K Overriding Makefiles}
#{\footnote Overriding_Makefiles}
${\footnote \pard{}Overriding Part of Another Makefile}\par
\pard{\fs24\b Overriding Part of Another Makefile}\par
\par
\pard{}{K{\footnote K overriding makefiles}}{K{\footnote K makefile, overriding}}Sometimes it is useful to have a makefile that is mostly just like another makefile.  You can often use the {\f1{}include} directive to include one in the other, and add more targets or variable definitions.  However, if the two makefiles give different commands for the same target, {\f1{}make} will not let you just do this.  But there is another way.\par
\par
\pard{}{K{\footnote K match-anything rule, used to override}}In the containing makefile (the one that wants to include the other), you can use a match-anything pattern rule to say that to remake any target that cannot be made from the information in the containing makefile, {\f1{}make} should look in another makefile.  See {\uldb Pattern Rules}{\v Pattern_Rules}, for more information on pattern rules.\par
\par
\pard{}For example, if you have a makefile called {\f1{}Makefile} that says how to make the target {\f1{}foo} (and other targets), you can write a makefile called {\f1{}GNUmakefile} that contains:\par
\par
{\pard\keep\li720\f1{}foo:\line
        frobnicate > foo\line
\line
%: force\line
        @$(MAKE) -f Makefile $@\line
force: ;\par
\pard\f0{}}\par
\pard{}If you say {\f1{}make foo}, {\f1{}make} will find {\f1{}GNUmakefile}, read it, and see that to make {\f1{}foo}, it needs to run the command {\f1{}frobnicate > foo}.  If you say {\f1{}make bar}, {\f1{}make} will find no way to make {\f1{}bar} in {\f1{}GNUmakefile}, so it will use the commands from the pattern rule: {\f1{}make -f Makefile bar}.  If {\f1{}Makefile} provides a rule for updating {\f1{}bar}, {\f1{}make} will apply the rule.  And likewise for any other target that {\f1{}GNUmakefile} does not say how to make.\par
\par
\pard{}The way this works is that the pattern rule has a pattern of just {\f1{}%}, so it matches any target whatever.  The rule specifies a prerequisite {\f1{}force}, to guarantee that the commands will be run even if the target file already exists.  We give {\f1{}force} target empty commands to prevent {\f1{}make} from searching for an implicit rule to build it--otherwise it would apply the same match-anything rule to {\f1{}force} itself and create a prerequisite loop!\par
\par
\page\pard Node: {\b Reading Makefiles}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Overriding Makefiles}{\v Overriding_Makefiles}, Up: {\uldb Makefiles}{\v Makefiles}\line
K{\footnote K Reading Makefiles}
#{\footnote Reading_Makefiles}
${\footnote \pard{}How {\f1{}make} Reads a Makefile}\par
\pard{\fs24\b How {\f1{}make} Reads a Makefile}\par
\par
\pard{}{K{\footnote K reading makefiles}}{K{\footnote K makefile, parsing}} GNU {\f1{}make} does its work in two distinct phases.  During the first phase it reads all the makefiles, included makefiles, etc. and internalizes all the variables and their values, implicit and explicit rules, and constructs a dependency graph of all the targets and their prerequisites.  During the second phase, {\f1{}make} uses these internal structures to determine what targets will need to be rebuilt and to invoke the rules necessary to do so.\par
\par
\pard{}It's important to understand this two-phase approach because it has a direct impact on how variable and function expansion happens; this is often a source of some confusion when writing makefiles.  Here we will present a summary of the phases in which expansion happens for different constructs within the makefile.  We say that expansion is \'A2immediate\'A2 if it happens during the first phase: in this case {\f1{}make} will expand any variables or functions in that section of a construct as the makefile is parsed.  We say that expansion is \'A2deferred\'A2 if expansion is not performed immediately.  Expansion of deferred construct is not performed until either the construct appears later in an immediate context, or until the second phase.\par
\par
\pard{}You may not be familiar with some of these constructs yet.  You can reference this section as you become familiar with them, in later chapters.\par
\par
\pard{\b Variable Assignment}\par
\par
\pard{}{K{\footnote K +=, expansion}}{K{\footnote K =, expansion}}{K{\footnote K ?=, expansion}}{K{\footnote K +=, expansion}}{K{\footnote K define, expansion}} Variable definitions are parsed as follows:\par
\par
{{\i \pard\li720\f1{}immediate} = {\i deferred}\line
{\i immediate} ?= {\i deferred}\line
{\i immediate} := {\i immediate}\line
{\i immediate} += {\i deferred} or {\i immediate}\line
\line
define {\i immediate}\line
  {\i deferred}\line
endef\par
\pard\f0{}}\par
\pard{}For the append operator, {\f1{}+=}, the right-hand side is considered immediate if the variable was previously set as a simple variable ({\f1{}:=}), and deferred otherwise.\par
\par
\pard{\b Conditional Syntax}\par
\par
\pard{}{K{\footnote K ifdef, expansion}}{K{\footnote K ifeq, expansion}}{K{\footnote K ifndef, expansion}}{K{\footnote K ifneq, expansion}} All instances of conditional syntax are parsed immediately, in their entirety; this includes the {\f1{}ifdef}, {\f1{}ifeq}, {\f1{}ifndef}, and {\f1{}ifneq} forms.\par
\par
\pard{\b Rule Definition}\par
\par
\pard{}{K{\footnote K target, expansion}}{K{\footnote K prerequisite, expansion}}{K{\footnote K implicit rule, expansion}}{K{\footnote K pattern rule, expansion}}{K{\footnote K explicit rule, expansion}} A rule is always expanded the same way, regardless of the form:\par
\par
{{\i \pard\li720\f1{}immediate} : {\i immediate} ; {\i deferred}\line
	{\i deferred}\par
\pard\f0{}}\par
\pard{}That is, the target and prerequisite sections are expanded immediately, and the commands used to construct the target are always deferred.  This general rule is true for explicit rules, pattern rules, suffix rules, static pattern rules, and simple prerequisite definitions.\par
\par
\page\pard Node: {\b Rules}, \keepn Next: {\uldb Commands}{\v Commands}, Prev: {\uldb Makefiles}{\v Makefiles}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Rules}
#{\footnote Rules}
${\footnote \pard{}Writing Rules}\par
\pard{\fs24\b Writing Rules}\par
\par
\pard{}{K{\footnote K writing rules}}{K{\footnote K rule, how to write}}{K{\footnote K target}}{K{\footnote K prerequisite}} A \'A2rule\'A2 appears in the makefile and says when and how to remake certain files, called the rule's \'A2targets\'A2 (most often only one per rule).  It lists the other files that are the \'A2prerequisites\'A2 of the target, and \'A2commands\'A2 to use to create or update the target.\par
\par
\pard{}{K{\footnote K default goal}}{K{\footnote K goal, default}}The order of rules is not significant, except for determining the \'A2default goal\'A2: the target for {\f1{}make} to consider, if you do not otherwise specify one.  The default goal is the target of the first rule in the first makefile.  If the first rule has multiple targets, only the first target is taken as the default.  There are two exceptions: a target starting with a period is not a default unless it contains one or more slashes, {\f1{}/}, as well; and, a target that defines a pattern rule has no effect on the default goal.  (See {\uldb Defining and Redefining Pattern Rules}{\v Pattern_Rules}.)\par
\par
\pard{}Therefore, we usually write the makefile so that the first rule is the one for compiling the entire program or all the programs described by the makefile (often with a target called {\f1{}all}).  See {\uldb Arguments to Specify the Goals}{\v Goals}.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Rule Example}{\v Rule_Example}\tab An example explained.\par
{\uldb Rule Syntax}{\v Rule_Syntax}\tab General syntax explained.\par
{\uldb Wildcards}{\v Wildcards}\tab Using wildcard characters such as `*'.\par
{\uldb Directory Search}{\v Directory_Search}\tab Searching other directories for source files.\par
{\uldb Phony Targets}{\v Phony_Targets}\tab Using a target that is not a real file's name.\par
{\uldb Force Targets}{\v Force_Targets}\tab You can use a target without commands or prerequisites to mark other targets as phony.\par
{\uldb Empty Targets}{\v Empty_Targets}\tab When only the date matters and the files are empty.\par
{\uldb Special Targets}{\v Special_Targets}\tab Targets with special built-in meanings.\par
{\uldb Multiple Targets}{\v Multiple_Targets}\tab When to make use of several targets in a rule.\par
{\uldb Multiple Rules}{\v Multiple_Rules}\tab How to use several rules with the same target.\par
{\uldb Static Pattern}{\v Static_Pattern}\tab Static pattern rules apply to multiple targets and can vary the prerequisites according to the target name.\par
{\uldb Double-Colon}{\v Double_Colon}\tab How to use a special kind of rule to allow several independent rules for one target.\par
{\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}\tab How to automatically generate rules giving prerequisites from source files themselves.\par
\pard{}}\par
{\page\pard Node: {\b Rule Example}, \keepn Next: {\uldb Rule Syntax}{\v Rule_Syntax}, Prev: {\uldb }{\v }, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Rule Example}
#{\footnote Rule_Example}
${\footnote \pard{}Rule Example}\par
\pard{\fs24\b Rule Example}\par
\par
\pard{}Here is an example of a rule:\par
\par
{\pard\keep\li720\f1{}foo.o : foo.c defs.h       # module for twiddling the frobs\line
        cc -c -g foo.c\par
\pard\f0{}}\par
\pard{}Its target is {\f1{}foo.o} and its prerequisites are {\f1{}foo.c} and {\f1{}defs.h}.  It has one command, which is {\f1{}cc -c -g foo.c}.  The command line starts with a tab to identify it as a command.\par
\par
\pard{}This rule says two things:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}How to decide whether {\f1{}foo.o} is out of date: it is out of date if it does not exist, or if either {\f1{}foo.c} or {\f1{}defs.h} is more recent than it.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}How to update the file {\f1{}foo.o}: by running {\f1{}cc} as stated.  The command does not explicitly mention {\f1{}defs.h}, but we presume that {\f1{}foo.c} includes it, and that that is why {\f1{}defs.h} was added to the prerequisites.\par
\pard{}}}\par
\page\pard Node: {\b Rule Syntax}, \keepn Next: {\uldb Wildcards}{\v Wildcards}, Prev: {\uldb Rule Example}{\v Rule_Example}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Rule Syntax}
#{\footnote Rule_Syntax}
${\footnote \pard{}Rule Syntax}\par
\pard{\fs24\b Rule Syntax}\par
\par
\pard{}{K{\footnote K rule syntax}}{K{\footnote K syntax of rules}}In general, a rule looks like this:\par
\par
{{\i \pard\li720\f1{}targets} : {\i prerequisites}\line
        {\i command}\line
        ...\par
\pard\f0{}}\par
\pard{}or like this:\par
\par
{{\i \pard\li720\f1{}targets} : {\i prerequisites} ; {\i command}\line
        {\i command}\line
        ...\par
\pard\f0{}}\par
\pard{}{K{\footnote K targets}}{K{\footnote K rule targets}}The {\i targets} are file names, separated by spaces.  Wildcard characters may be used (see {\uldb Using Wildcard Characters in File Names}{\v Wildcards}) and a name of the form {\f1{}{\i a}({\i m})} represents member {\i m} in archive file {\i a} (see {\uldb Archive Members as Targets}{\v Archive_Members}).  Usually there is only one target per rule, but occasionally there is a reason to have more (see {\uldb Multiple Targets in a Rule}{\v Multiple_Targets}).\par
\par
\pard{}{K{\footnote K commands}}{K{\footnote K tab character (in commands)}}The {\i command} lines start with a tab character.  The first command may appear on the line after the prerequisites, with a tab character, or may appear on the same line, with a semicolon.  Either way, the effect is the same.  See {\uldb Writing the Commands in Rules}{\v Commands}.\par
\par
\pard{}{K{\footnote K dollar sign ({\f1{}$}), in rules}}{K{\footnote K {\f1{}$}, in rules}}{K{\footnote K rule, and {\f1{}$}}}Because dollar signs are used to start variable references, if you really want a dollar sign in a rule you must write two of them, {\f1{}$$} (see {\uldb How to Use Variables}{\v Using_Variables}).  You may split a long line by inserting a backslash followed by a newline, but this is not required, as {\f1{}make} places no limit on the length of a line in a makefile.\par
\par
\pard{}A rule tells {\f1{}make} two things: when the targets are out of date, and how to update them when necessary.\par
\par
\pard{}{K{\footnote K prerequisites}}{K{\footnote K rule prerequisites}}The criterion for being out of date is specified in terms of the {\i prerequisites}, which consist of file names separated by spaces.  (Wildcards and archive members (see {\uldb Archives}{\v Archives}) are allowed here too.)  A target is out of date if it does not exist or if it is older than any of the prerequisites (by comparison of last-modification times).  The idea is that the contents of the target file are computed based on information in the prerequisites, so if any of the prerequisites changes, the contents of the existing target file are no longer necessarily valid.\par
\par
\pard{}How to update is specified by {\i commands}.  These are lines to be executed by the shell (normally {\f1{}sh}), but with some extra features (see {\uldb Writing the Commands in Rules}{\v Commands}).\par
\par
\page\pard Node: {\b Wildcards}, \keepn Next: {\uldb Directory Search}{\v Directory_Search}, Prev: {\uldb Rule Syntax}{\v Rule_Syntax}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Wildcards}
#{\footnote Wildcards}
${\footnote \pard{}Using Wildcard Characters in File Names}\par
\pard{\fs24\b Using Wildcard Characters in File Names}\par
\par
\pard{}{K{\footnote K wildcard}}{K{\footnote K file name with wildcards}}{K{\footnote K globbing (wildcards)}} {K{\footnote K {\f1{}*} (wildcard character)}}{K{\footnote K {\f1{}?} (wildcard character)}}{K{\footnote K {\f1{}[...]} (wildcard characters)}}A single file name can specify many files using \'A2wildcard characters\'A2.  The wildcard characters in {\f1{}make} are {\f1{}*}, {\f1{}?} and {\f1{}[...]}, the same as in the Bourne shell.  For example, {\f1{}*.c} specifies a list of all the files (in the working directory) whose names end in {\f1{}.c}.\par
\par
\pard{}{K{\footnote K {\f1{}~} (tilde)}}{K{\footnote K tilde ({\f1{}~})}}{K{\footnote K home directory}}The character {\f1{}~} at the beginning of a file name also has special significance.  If alone, or followed by a slash, it represents your home directory.  For example {\f1{}~/bin} expands to {\f1{}/home/you/bin}.  If the {\f1{}~} is followed by a word, the string represents the home directory of the user named by that word.  For example {\f1{}~john/bin} expands to {\f1{}/home/john/bin}.  On systems which don't have a home directory for each user (such as MS-DOS or MS-Windows), this functionality can be simulated by setting the environment variable {\i HOME}.\par
\par
\pard{}Wildcard expansion happens automatically in targets, in prerequisites, and in commands (where the shell does the expansion).  In other contexts, wildcard expansion happens only if you request it explicitly with the {\f1{}wildcard} function.\par
\par
\pard{}The special significance of a wildcard character can be turned off by preceding it with a backslash.  Thus, {\f1{}foo\'5C*bar} would refer to a specific file whose name consists of {\f1{}foo}, an asterisk, and {\f1{}bar}.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Wildcard Examples}{\v Wildcard_Examples}\tab Several examples\par
{\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}\tab Problems to avoid.\par
{\uldb Wildcard Function}{\v Wildcard_Function}\tab How to cause wildcard expansion where it does not normally take place.\par
\pard{}}\par
\page\pard Node: {\b Wildcard Examples}, \keepn Next: {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}, Prev: {\uldb }{\v }, Up: {\uldb Wildcards}{\v Wildcards}\line
K{\footnote K Wildcard Examples}
#{\footnote Wildcard_Examples}
${\footnote \pard{}Wildcard Examples}\par
\pard{\fs24\b Wildcard Examples}\par
\par
\pard{}Wildcards can be used in the commands of a rule, where they are expanded by the shell.  For example, here is a rule to delete all the object files:\par
\par
{{\pard\keep\li720\f1{}clean:\line
        rm -f *.o\par
\pard\keep\li720{}}}{K{\footnote K {\f1{}rm} (shell command)}} Wildcards are also useful in the prerequisites of a rule.  With the following rule in the makefile, {\f1{}make print} will print all the {\f1{}.c} files that have changed since the last time you printed them:\par
\par
{\pard\keep\li720{}print: *.c\line
        lpr -p $?\line
        touch print\par
\pard\f0{}}\par
\pard{}{K{\footnote K {\f1{}print} target}}{K{\footnote K {\f1{}lpr} (shell command)}}{K{\footnote K {\f1{}touch} (shell command)}} This rule uses {\f1{}print} as an empty target file; see {\uldb Empty Target Files to Record Events}{\v Empty_Targets}.  (The automatic variable {\f1{}$?} is used to print only those files that have changed; see {\uldb Automatic Variables}{\v Automatic}.)\par
\par
\pard{}Wildcard expansion does not happen when you define a variable.  Thus, if you write this:\par
\par
{\pard\keep\li720\f1{}objects = *.o\par
\pard\f0{}}\par
\pard{}then the value of the variable {\f1{}objects} is the actual string {\f1{}*.o}.  However, if you use the value of {\f1{}objects} in a target, prerequisite or command, wildcard expansion will take place at that time.  To set {\f1{}objects} to the expansion, instead use:\par
\par
{\pard\keep\li720\f1{}objects := $(wildcard *.o)\par
\pard\f0{}}\par
\pard{}See {\uldb Wildcard Function}{\v Wildcard_Function}.\par
\par
\page\pard Node: {\b Wildcard Pitfall}, \keepn Next: {\uldb Wildcard Function}{\v Wildcard_Function}, Prev: {\uldb Wildcard Examples}{\v Wildcard_Examples}, Up: {\uldb Wildcards}{\v Wildcards}\line
K{\footnote K Wildcard Pitfall}
#{\footnote Wildcard_Pitfall}
${\footnote \pard{}Pitfalls of Using Wildcards}\par
\pard{\fs24\b Pitfalls of Using Wildcards}\par
\par
\pard{}{K{\footnote K wildcard pitfalls}}{K{\footnote K pitfalls of wildcards}}{K{\footnote K mistakes with wildcards}}{K{\footnote K errors with wildcards}}{K{\footnote K problems with wildcards}} Now here is an example of a naive way of using wildcard expansion, that does not do what you would intend.  Suppose you would like to say that the executable file {\f1{}foo} is made from all the object files in the directory, and you write this:\par
\par
{\pard\keep\li720\f1{}objects = *.o\line
\line
foo : $(objects)\line
        cc -o foo $(CFLAGS) $(objects)\par
\pard\f0{}}\par
\pard{}The value of {\f1{}objects} is the actual string {\f1{}*.o}.  Wildcard expansion happens in the rule for {\f1{}foo}, so that each {\i existing} {\f1{}.o} file becomes a prerequisite of {\f1{}foo} and will be recompiled if necessary.\par
\par
\pard{}But what if you delete all the {\f1{}.o} files?  When a wildcard matches no files, it is left as it is, so then {\f1{}foo} will depend on the oddly-named file {\f1{}*.o}.  Since no such file is likely to exist, {\f1{}make} will give you an error saying it cannot figure out how to make {\f1{}*.o}.  This is not what you want!\par
\par
\pard{}Actually it is possible to obtain the desired result with wildcard expansion, but you need more sophisticated techniques, including the {\f1{}wildcard} function and string substitution.  {See {\uldb The Function {\f1{}wildcard}}{\v Wildcard_Function}.  }\par
\par
\pard{}{K{\footnote K wildcards and MS-DOS/MS-Windows backslashes}}{K{\footnote K backslashes in pathnames and wildcard expansion}} Microsoft operating systems (MS-DOS and MS-Windows) use backslashes to separate directories in pathnames, like so:\par
\par
{\pard\keep\li720\f1{}  c:\'5Cfoo\'5Cbar\'5Cbaz.c\par
\pard\f0{}}\par
\pard{}This is equivalent to the Unix-style {\f1{}c:/foo/bar/baz.c} (the {\f1{}c:} part is the so-called drive letter).  When {\f1{}make} runs on these systems, it supports backslashes as well as the Unix-style forward slashes in pathnames.  However, this support does {\i not} include the wildcard expansion, where backslash is a quote character.  Therefore, you {\i must} use Unix-style slashes in these cases.\par
\par
\page\pard Node: {\b Wildcard Function}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}, Up: {\uldb Wildcards}{\v Wildcards}\line
K{\footnote K Wildcard Function}
#{\footnote Wildcard_Function}
${\footnote \pard{}The Function {\f1{}wildcard}}\par
\pard{\fs24\b The Function {\f1{}wildcard}}\par
\par
\pard{}{K{\footnote K wildcard}} Wildcard expansion happens automatically in rules.  But wildcard expansion does not normally take place when a variable is set, or inside the arguments of a function.  If you want to do wildcard expansion in such places, you need to use the {\f1{}wildcard} function, like this:\par
\par
{\pard\keep\li720\f1{}$(wildcard {\i pattern}...)\par
\pard\f0{}}\par
\pard{}This string, used anywhere in a makefile, is replaced by a space-separated list of names of existing files that match one of the given file name patterns.  If no existing file name matches a pattern, then that pattern is omitted from the output of the {\f1{}wildcard} function.  Note that this is different from how unmatched wildcards behave in rules, where they are used verbatim rather than ignored (see {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}).\par
\par
\pard{}One use of the {\f1{}wildcard} function is to get a list of all the C source files in a directory, like this:\par
\par
{\pard\keep\li720\f1{}$(wildcard *.c)\par
\pard\f0{}}\par
\pard{}We can change the list of C source files into a list of object files by replacing the {\f1{}.c} suffix with {\f1{}.o} in the result, like this:\par
\par
{\pard\keep\li720\f1{}$(patsubst %.c,%.o,$(wildcard *.c))\par
\pard\f0{}}\par
\pard{}(Here we have used another function, {\f1{}patsubst}.  See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.)\par
\par
\pard{}Thus, a makefile to compile all C source files in the directory and then link them together could be written as follows:\par
\par
{\pard\keep\li720\f1{}objects := $(patsubst %.c,%.o,$(wildcard *.c))\line
\line
foo : $(objects)\line
        cc -o foo $(objects)\par
\pard\f0{}}\par
\pard{}(This takes advantage of the implicit rule for compiling C programs, so there is no need to write explicit rules for compiling the files.  See {\uldb The Two Flavors of Variables}{\v Flavors}, for an explanation of {\f1{}:=}, which is a variant of {\f1{}=}.)\par
\par
\page\pard Node: {\b Directory Search}, \keepn Next: {\uldb Phony Targets}{\v Phony_Targets}, Prev: {\uldb Wildcards}{\v Wildcards}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Directory Search}
#{\footnote Directory_Search}
${\footnote \pard{}Searching Directories for Prerequisites}\par
\pard{\fs24\b Searching Directories for Prerequisites}\par
\par
\pard{}{K{\footnote K VPATH}}{K{\footnote K vpath}}{K{\footnote K vpath}}{K{\footnote K search path for prerequisites ({\f1{}VPATH})}}{K{\footnote K directory search ({\f1{}VPATH})}} For large systems, it is often desirable to put sources in a separate directory from the binaries.  The \'A2directory search\'A2 features of {\f1{}make} facilitate this by searching several directories automatically to find a prerequisite.  When you redistribute the files among directories, you do not need to change the individual rules, just the search paths.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb General Search}{\v General_Search}\tab Specifying a search path that applies to every prerequisite.\par
{\uldb Selective Search}{\v Selective_Search}\tab Specifying a search path for a specified class of names.\par
{\uldb Search Algorithm}{\v Search_Algorithm}\tab When and how search paths are applied.\par
{\uldb Commands/Search}{\v Commands_Search}\tab How to write shell commands that work together with search paths.\par
{\uldb Implicit/Search}{\v Implicit_Search}\tab How search paths affect implicit rules.\par
{\uldb Libraries/Search}{\v Libraries_Search}\tab Directory search for link libraries.\par
\pard{}}\par
\page\pard Node: {\b General Search}, \keepn Next: {\uldb Selective Search}{\v Selective_Search}, Prev: {\uldb }{\v }, Up: {\uldb Directory Search}{\v Directory_Search}\line
K{\footnote K General Search}
#{\footnote General_Search}
${\footnote {\f1{}\pard{}VPATH}: Search Path for All Prerequisites}\par
\pard{\fs24\b {\f1{}VPATH}: Search Path for All Prerequisites}\par
\par
\pard{}{K{\footnote K VPATH}} The value of the {\f1{}make} variable {\f1{}VPATH} specifies a list of directories that {\f1{}make} should search.  Most often, the directories are expected to contain prerequisite files that are not in the current directory; however, {\f1{}VPATH} specifies a search list that {\f1{}make} applies for all files, including files which are targets of rules.\par
\par
\pard{}Thus, if a file that is listed as a target or prerequisite does not exist in the current directory, {\f1{}make} searches the directories listed in {\f1{}VPATH} for a file with that name.  If a file is found in one of them, that file may become the prerequisite (see below).  Rules may then specify the names of files in the prerequisite list as if they all existed in the current directory.  See {\uldb Writing Shell Commands with Directory Search}{\v Commands_Search}.\par
\par
\pard{}In the {\f1{}VPATH} variable, directory names are separated by colons or blanks.  The order in which directories are listed is the order followed by {\f1{}make} in its search.  (On MS-DOS and MS-Windows, semi-colons are used as separators of directory names in {\f1{}VPATH}, since the colon can be used in the pathname itself, after the drive letter.)\par
\par
\pard{}For example,\par
\par
{\pard\keep\li720\f1{}VPATH = src:../headers\par
\pard\f0{}}\par
\pard{}specifies a path containing two directories, {\f1{}src} and {\f1{}../headers}, which {\f1{}make} searches in that order.\par
\par
\pard{}With this value of {\f1{}VPATH}, the following rule,\par
\par
{\pard\keep\li720\f1{}foo.o : foo.c\par
\pard\f0{}}\par
\pard{}is interpreted as if it were written like this:\par
\par
{\pard\keep\li720\f1{}foo.o : src/foo.c\par
\pard\f0{}}\par
\pard{}assuming the file {\f1{}foo.c} does not exist in the current directory but is found in the directory {\f1{}src}.\par
\par
\page\pard Node: {\b Selective Search}, \keepn Next: {\uldb Search Algorithm}{\v Search_Algorithm}, Prev: {\uldb General Search}{\v General_Search}, Up: {\uldb Directory Search}{\v Directory_Search}\line
K{\footnote K Selective Search}
#{\footnote Selective_Search}
${\footnote \pard{}The {\f1{}vpath} Directive}\par
\pard{\fs24\b The {\f1{}vpath} Directive}\par
\par
\pard{}{K{\footnote K vpath}} Similar to the {\f1{}VPATH} variable, but more selective, is the {\f1{}vpath} directive (note lower case), which allows you to specify a search path for a particular class of file names: those that match a particular pattern.  Thus you can supply certain search directories for one class of file names and other directories (or none) for other file names.\par
\par
\pard{}There are three forms of the {\f1{}vpath} directive:\par
\par
{\pard{}{\f1{}vpath {\i pattern} {\i directories}}\par
\pard\li720{}Specify the search path {\i directories} for file names that match {\i pattern}.\par
\par
\pard\li720{}The search path, {\i directories}, is a list of directories to be searched, separated by colons (semi-colons on MS-DOS and MS-Windows) or blanks, just like the search path used in the {\f1{}VPATH} variable.\par
\par
\pard{}{\f1{}vpath {\i pattern}}\par
\pard\li720{}Clear out the search path associated with {\i pattern}.\par
\par
\pard{}{\f1{}vpath}\par
\pard\li720{}Clear all search paths previously specified with {\f1{}vpath} directives.\par
\pard{}}\par
\pard{}A {\f1{}vpath} pattern is a string containing a {\f1{}%} character.  The string must match the file name of a prerequisite that is being searched for, the {\f1{}%} character matching any sequence of zero or more characters (as in pattern rules; see {\uldb Defining and Redefining Pattern Rules}{\v Pattern_Rules}).  For example, {\f1{}%.h} matches files that end in {\f1{}.h}.  (If there is no {\f1{}%}, the pattern must match the prerequisite exactly, which is not useful very often.)\par
\par
\pard{}{K{\footnote K {\f1{}%}, quoting in {\f1{}vpath}}}{K{\footnote K {\f1{}%}, quoting with {\f1{}\'5C} (backslash)}}{K{\footnote K {\f1{}\'5C} (backslash), to quote {\f1{}%}}}{K{\footnote K backslash ({\f1{}\'5C}), to quote {\f1{}%}}}{K{\footnote K quoting {\f1{}%}, in {\f1{}vpath}}}{\f1{}%} characters in a {\f1{}vpath} directive's pattern can be quoted with preceding backslashes ({\f1{}\'5C}).  Backslashes that would otherwise quote {\f1{}%} characters can be quoted with more backslashes.  Backslashes that quote {\f1{}%} characters or other backslashes are removed from the pattern before it is compared to file names.  Backslashes that are not in danger of quoting {\f1{}%} characters go unmolested.\par
\par
\pard{}When a prerequisite fails to exist in the current directory, if the {\i pattern} in a {\f1{}vpath} directive matches the name of the prerequisite file, then the {\i directories} in that directive are searched just like (and before) the directories in the {\f1{}VPATH} variable.\par
\par
\pard{}For example,\par
\par
{\pard\keep\li720\f1{}vpath %.h ../headers\par
\pard\f0{}}\par
\pard{}tells {\f1{}make} to look for any prerequisite whose name ends in {\f1{}.h} in the directory {\f1{}../headers} if the file is not found in the current directory.\par
\par
\pard{}If several {\f1{}vpath} patterns match the prerequisite file's name, then {\f1{}make} processes each matching {\f1{}vpath} directive one by one, searching all the directories mentioned in each directive.  {\f1{}make} handles multiple {\f1{}vpath} directives in the order in which they appear in the makefile; multiple directives with the same pattern are independent of each other.\par
\par
\pard{}Thus,\par
\par
{{\pard\keep\li720\f1{}vpath %.c foo\line
vpath %   blish\line
vpath %.c bar\par
\pard\keep\li720{}}}\par
\pard\f0{}will look for a file ending in {\f1{}.c} in {\f1{}foo}, then {\f1{}blish}, then {\f1{}bar}, while\par
\par
{{\pard\keep\li720\f1{}vpath %.c foo:bar\line
vpath %   blish\par
\pard\keep\li720{}}}\par
\pard\f0{}will look for a file ending in {\f1{}.c} in {\f1{}foo}, then {\f1{}bar}, then {\f1{}blish}.\par
\par
\page\pard Node: {\b Search Algorithm}, \keepn Next: {\uldb Commands/Search}{\v Commands_Search}, Prev: {\uldb Selective Search}{\v Selective_Search}, Up: {\uldb Directory Search}{\v Directory_Search}\line
K{\footnote K Search Algorithm}
#{\footnote Search_Algorithm}
${\footnote \pard{}How Directory Searches are Performed}\par
\pard{\fs24\b How Directory Searches are Performed}\par
\par
\pard{}{K{\footnote K algorithm for directory search}}{K{\footnote K directory search algorithm}} When a prerequisite is found through directory search, regardless of type (general or selective), the pathname located may not be the one that {\f1{}make} actually provides you in the prerequisite list.  Sometimes the path discovered through directory search is thrown away.\par
\par
\pard{}The algorithm {\f1{}make} uses to decide whether to keep or abandon a path found via directory search is as follows:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}1. \tab{}If a target file does not exist at the path specified in the makefile, directory search is performed.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}2. \tab{}If the directory search is successful, that path is kept and this file is tentatively stored as the target.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}3. \tab{}All prerequisites of this target are examined using this same method.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}4. \tab{}After processing the prerequisites, the target may or may not need to be rebuilt:\par
\par
{\pard\fi-720\li1440\tx864\tx1440{}\tab{}a.\tab{}If the target does {\i not} need to be rebuilt, the path to the file found during directory search is used for any prerequisite lists which contain this target.  In short, if {\f1{}make} doesn't need to rebuild the target then you use the path found via directory search.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}b.\tab{}If the target {\i does} need to be rebuilt (is out-of-date), the pathname found during directory search is {\i thrown away}, and the target is rebuilt using the file name specified in the makefile.  In short, if {\f1{}make} must rebuild, then the target is rebuilt locally, not in the directory found via directory search.\par
\pard\li720{}}}\par
\pard{}This algorithm may seem complex, but in practice it is quite often exactly what you want.\par
\par
\pard{}{K{\footnote K traditional directory search}}{K{\footnote K directory search, traditional}}Other versions of {\f1{}make} use a simpler algorithm: if the file does not exist, and it is found via directory search, then that pathname is always used whether or not the target needs to be built.  Thus, if the target is rebuilt it is created at the pathname discovered during directory search.\par
\par
\pard{}{K{\footnote K GPATH}}If, in fact, this is the behavior you want for some or all of your directories, you can use the {\f1{}GPATH} variable to indicate this to {\f1{}make}.\par
\par
{\f1{}\pard{}GPATH} has the same syntax and format as {\f1{}VPATH} (that is, a space- or colon-delimited list of pathnames).  If an out-of-date target is found by directory search in a directory that also appears in {\f1{}GPATH}, then that pathname is not thrown away.  The target is rebuilt using the expanded path.\par
\par
\page\pard Node: {\b Commands/Search}, \keepn Next: {\uldb Implicit/Search}{\v Implicit_Search}, Prev: {\uldb Search Algorithm}{\v Search_Algorithm}, Up: {\uldb Directory Search}{\v Directory_Search}\line
K{\footnote K Commands/Search}
#{\footnote Commands_Search}
${\footnote \pard{}Writing Shell Commands with Directory Search}\par
\pard{\fs24\b Writing Shell Commands with Directory Search}\par
\par
\pard{}{K{\footnote K shell command, and directory search}}{K{\footnote K directory search ({\f1{}VPATH}), and shell commands}} When a prerequisite is found in another directory through directory search, this cannot change the commands of the rule; they will execute as written.  Therefore, you must write the commands with care so that they will look for the prerequisite in the directory where {\f1{}make} finds it.\par
\par
\pard{}This is done with the \'A2automatic variables\'A2 such as {\f1{}$^} (see {\uldb Automatic Variables}{\v Automatic}).  For instance, the value of {\f1{}$^} is a list of all the prerequisites of the rule, including the names of the directories in which they were found, and the value of {\f1{}$@} is the target.  Thus:\par
\par
{\pard\keep\li720\f1{}foo.o : foo.c\line
        cc -c $(CFLAGS) $^ -o $@\par
\pard\f0{}}\par
\pard{}(The variable {\f1{}CFLAGS} exists so you can specify flags for C compilation by implicit rules; we use it here for consistency so it will affect all C compilations uniformly; see {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}.)\par
\par
\pard{}Often the prerequisites include header files as well, which you do not want to mention in the commands.  The automatic variable {\f1{}$<} is just the first prerequisite:\par
\par
{\pard\keep\li720\f1{}VPATH = src:../headers\line
foo.o : foo.c defs.h hack.h\line
        cc -c $(CFLAGS) $< -o $@\par
\pard\f0{}}\par
\page\pard Node: {\b Implicit/Search}, \keepn Next: {\uldb Libraries/Search}{\v Libraries_Search}, Prev: {\uldb Commands/Search}{\v Commands_Search}, Up: {\uldb Directory Search}{\v Directory_Search}\line
K{\footnote K Implicit/Search}
#{\footnote Implicit_Search}
${\footnote \pard{}Directory Search and Implicit Rules}\par
\pard{\fs24\b Directory Search and Implicit Rules}\par
\par
\pard{}{K{\footnote K {\f1{}VPATH}, and implicit rules}}{K{\footnote K directory search ({\f1{}VPATH}), and implicit rules}}{K{\footnote K search path for prerequisites ({\f1{}VPATH}), and implicit rules}}{K{\footnote K implicit rule, and directory search}}{K{\footnote K implicit rule, and {\f1{}VPATH}}}{K{\footnote K rule, implicit, and directory search}}{K{\footnote K rule, implicit, and {\f1{}VPATH}}} The search through the directories specified in {\f1{}VPATH} or with {\f1{}vpath} also happens during consideration of implicit rules (see {\uldb Using Implicit Rules}{\v Implicit_Rules}).\par
\par
\pard{}For example, when a file {\f1{}foo.o} has no explicit rule, {\f1{}make} considers implicit rules, such as the built-in rule to compile {\f1{}foo.c} if that file exists.  If such a file is lacking in the current directory, the appropriate directories are searched for it.  If {\f1{}foo.c} exists (or is mentioned in the makefile) in any of the directories, the implicit rule for C compilation is applied.\par
\par
\pard{}The commands of implicit rules normally use automatic variables as a matter of necessity; consequently they will use the file names found by directory search with no extra effort.\par
\par
\page\pard Node: {\b Libraries/Search}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Implicit/Search}{\v Implicit_Search}, Up: {\uldb Directory Search}{\v Directory_Search}\line
K{\footnote K Libraries/Search}
#{\footnote Libraries_Search}
${\footnote \pard{}Directory Search for Link Libraries}\par
\pard{\fs24\b Directory Search for Link Libraries}\par
\par
\pard{}{K{\footnote K link libraries, and directory search}}{K{\footnote K libraries for linking, directory search}}{K{\footnote K directory search ({\f1{}VPATH}), and link libraries}}{K{\footnote K {\f1{}VPATH}, and link libraries}}{K{\footnote K search path for prerequisites ({\f1{}VPATH}), and link libraries}}{K{\footnote K {\f1{}-l} (library search)}}{K{\footnote K link libraries, patterns matching}}{K{\footnote K {\f1{}.LIBPATTERNS}, and link libraries}}{K{\footnote K .LIBPATTERNS}} Directory search applies in a special way to libraries used with the linker.  This special feature comes into play when you write a prerequisite whose name is of the form {\f1{}-l{\i name}}.  (You can tell something strange is going on here because the prerequisite is normally the name of a file, and the {\i file name} of a library generally looks like {\f1{}lib{\i name}.a}, not like {\f1{}-l{\i name}}.)\par
\par
\pard{}When a prerequisite's name has the form {\f1{}-l{\i name}}, {\f1{}make} handles it specially by searching for the file {\f1{}lib{\i name}.so} in the current directory, in directories specified by matching {\f1{}vpath} search paths and the {\f1{}VPATH} search path, and then in the directories {\f1{}/lib}, {\f1{}/usr/lib}, and {\f1{}{\i prefix}/lib} (normally {\f1{}/usr/local/lib}, but MS-DOS/MS-Windows versions of {\f1{}make} behave as if {\i prefix} is defined to be the root of the DJGPP installation tree).\par
\par
\pard{}If that file is not found, then the file {\f1{}lib{\i name}.a} is searched for, in the same directories as above.\par
\par
\pard{}For example, if there is a {\f1{}/usr/lib/libcurses.a} library on your system (and no {\f1{}/usr/lib/libcurses.so} file), then\par
\par
{{\pard\keep\li720\f1{}foo : foo.c -lcurses\line
        cc $^ -o $@\par
\pard\keep\li720{}}}\par
\pard\f0{}would cause the command {\f1{}cc foo.c /usr/lib/libcurses.a -o foo} to be executed when {\f1{}foo} is older than {\f1{}foo.c} or than {\f1{}/usr/lib/libcurses.a}.\par
\par
\pard{}Although the default set of files to be searched for is {\f1{}lib{\i name}.so} and {\f1{}lib{\i name}.a}, this is customizable via the {\f1{}.LIBPATTERNS} variable.  Each word in the value of this variable is a pattern string.  When a prerequisite like {\f1{}-l{\i name}} is seen, {\f1{}make} will replace the percent in each pattern in the list with {\i name} and perform the above directory searches using that library filename.  If no library is found, the next word in the list will be used.\par
\par
\pard{}The default value for {\f1{}.LIBPATTERNS} is "{\f1{}lib%.so lib%.a}", which provides the default behavior described above.\par
\par
\pard{}You can turn off link library expansion completely by setting this variable to an empty value.\par
\par
\page\pard Node: {\b Phony Targets}, \keepn Next: {\uldb Force Targets}{\v Force_Targets}, Prev: {\uldb Directory Search}{\v Directory_Search}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Phony Targets}
#{\footnote Phony_Targets}
${\footnote \pard{}Phony Targets}\par
\pard{\fs24\b Phony Targets}\par
\par
\pard{}{K{\footnote K phony targets}}{K{\footnote K targets, phony}}{K{\footnote K targets without a file}} A phony target is one that is not really the name of a file.  It is just a name for some commands to be executed when you make an explicit request.  There are two reasons to use a phony target: to avoid a conflict with a file of the same name, and to improve performance.\par
\par
\pard{}If you write a rule whose commands will not create the target file, the commands will be executed every time the target comes up for remaking.  Here is an example:\par
\par
{{\pard\keep\li720\f1{}clean:\line
        rm *.o temp\par
\pard\keep\li720{}}}\par
\pard\f0{}Because the {\f1{}rm} command does not create a file named {\f1{}clean}, probably no such file will ever exist.  Therefore, the {\f1{}rm} command will be executed every time you say {\f1{}make clean}.  {K{\footnote K {\f1{}rm} (shell command)}} {K{\footnote K .PHONY}}The phony target will cease to work if anything ever does create a file named {\f1{}clean} in this directory.  Since it has no prerequisites, the file {\f1{}clean} would inevitably be considered up to date, and its commands would not be executed.  To avoid this problem, you can explicitly declare the target to be phony, using the special target {\f1{}.PHONY} (see {\uldb Special Built-in Target Names}{\v Special_Targets}) as follows:\par
\par
{\pard\keep\li720\f1{}.PHONY : clean\par
\pard\f0{}}\par
\pard{}Once this is done, {\f1{}make clean} will run the commands regardless of whether there is a file named {\f1{}clean}.\par
\par
\pard{}Since it knows that phony targets do not name actual files that could be remade from other files, {\f1{}make} skips the implicit rule search for phony targets (see {\uldb Implicit Rules}{\v Implicit_Rules}).  This is why declaring a target phony is good for performance, even if you are not worried about the actual file existing.\par
\par
\pard{}Thus, you first write the line that states that {\f1{}clean} is a phony target, then you write the rule, like this:\par
\par
{{\pard\keep\li720\f1{}.PHONY: clean\line
clean:\line
        rm *.o temp\par
\pard\keep\li720{}}}\par
\pard\f0{}Another example of the usefulness of phony targets is in conjunction with recursive invocations of {\f1{}make}.  In this case the makefile will often contain a variable which lists a number of subdirectories to be built.  One way to handle this is with one rule whose command is a shell loop over the subdirectories, like this:\par
\par
{{\pard\keep\li720\f1{}SUBDIRS = foo bar baz\line
\line
subdirs:\line
        for dir in $(SUBDIRS); do \'5C\line
          $(MAKE) -C $$dir; \'5C\line
        done\par
\pard\keep\li720{}}}\par
\pard\f0{}There are a few of problems with this method, however.  First, any error detected in a submake is not noted by this rule, so it will continue to build the rest of the directories even when one fails.  This can be overcome by adding shell commands to note the error and exit, but then it will do so even if {\f1{}make} is invoked with the {\f1{}-k} option, which is unfortunate.  Second, and perhaps more importantly, you cannot take advantage of the parallel build capabilities of make using this method, since there is only one rule.\par
\par
\pard{}By declaring the subdirectories as phony targets (you must do this as the subdirectory obviously always exists; otherwise it won't be built) you can remove these problems:\par
\par
{{\pard\keep\li720\f1{}SUBDIRS = foo bar baz\line
\line
.PHONY: subdirs $(SUBDIRS)\line
\line
subdirs: $(SUBDIRS)\line
\line
$(SUBDIRS):\line
        $(MAKE) -C $ \line
foo: baz\par
\pard\keep\li720{}}}\par
\pard\f0{}Here we've also declared that the {\f1{}foo} subdirectory cannot be built until after the {\f1{}baz} subdirectory is complete; this kind of relationship declaration is particularly important when attempting parallel builds.\par
\par
\pard{}A phony target should not be a prerequisite of a real target file; if it is, its commands are run every time {\f1{}make} goes to update that file.  As long as a phony target is never a prerequisite of a real target, the phony target commands will be executed only when the phony target is a specified goal (see {\uldb Arguments to Specify the Goals}{\v Goals}).\par
\par
\pard{}Phony targets can have prerequisites.  When one directory contains multiple programs, it is most convenient to describe all of the programs in one makefile {\f1{}./Makefile}.  Since the target remade by default will be the first one in the makefile, it is common to make this a phony target named {\f1{}all} and give it, as prerequisites, all the individual programs.  For example:\par
\par
{\pard\keep\li720\f1{}all : prog1 prog2 prog3\line
.PHONY : all\line
\line
prog1 : prog1.o utils.o\line
        cc -o prog1 prog1.o utils.o\line
\line
prog2 : prog2.o\line
        cc -o prog2 prog2.o\line
\line
prog3 : prog3.o sort.o utils.o\line
        cc -o prog3 prog3.o sort.o utils.o\par
\pard\f0{}}\par
\pard{}Now you can say just {\f1{}make} to remake all three programs, or specify as arguments the ones to remake (as in {\f1{}make prog1 prog3}).\par
\par
\pard{}When one phony target is a prerequisite of another, it serves as a subroutine of the other.  For example, here {\f1{}make cleanall} will delete the object files, the difference files, and the file {\f1{}program}:\par
\par
{\pard\keep\li720\f1{}.PHONY: cleanall cleanobj cleandiff\line
\line
cleanall : cleanobj cleandiff\line
        rm program\line
\line
cleanobj :\line
        rm *.o\line
\line
cleandiff :\line
        rm *.diff\par
\pard\f0{}}\par
\page\pard Node: {\b Force Targets}, \keepn Next: {\uldb Empty Targets}{\v Empty_Targets}, Prev: {\uldb Phony Targets}{\v Phony_Targets}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Force Targets}
#{\footnote Force_Targets}
${\footnote \pard{}Rules without Commands or Prerequisites}\par
\pard{\fs24\b Rules without Commands or Prerequisites}\par
\par
\pard{}{K{\footnote K force targets}}{K{\footnote K targets, force}}{K{\footnote K {\f1{}FORCE}}}{K{\footnote K rule, no commands or prerequisites}} If a rule has no prerequisites or commands, and the target of the rule is a nonexistent file, then {\f1{}make} imagines this target to have been updated whenever its rule is run.  This implies that all targets depending on this one will always have their commands run.\par
\par
\pard{}An example will illustrate this:\par
\par
{{\pard\keep\li720\f1{}clean: FORCE\line
        rm $(objects)\line
FORCE:\par
\pard\keep\li720{}}}\par
\pard\f0{}Here the target {\f1{}FORCE} satisfies the special conditions, so the target {\f1{}clean} that depends on it is forced to run its commands.  There is nothing special about the name {\f1{}FORCE}, but that is one name commonly used this way.\par
\par
\pard{}As you can see, using {\f1{}FORCE} this way has the same results as using {\f1{}.PHONY: clean}.\par
\par
\pard{}Using {\f1{}.PHONY} is more explicit and more efficient.  However, other versions of {\f1{}make} do not support {\f1{}.PHONY}; thus {\f1{}FORCE} appears in many makefiles.  See {\uldb Phony Targets}{\v Phony_Targets}.\par
\par
\page\pard Node: {\b Empty Targets}, \keepn Next: {\uldb Special Targets}{\v Special_Targets}, Prev: {\uldb Force Targets}{\v Force_Targets}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Empty Targets}
#{\footnote Empty_Targets}
${\footnote \pard{}Empty Target Files to Record Events}\par
\pard{\fs24\b Empty Target Files to Record Events}\par
\par
\pard{}{K{\footnote K empty targets}}{K{\footnote K targets, empty}}{K{\footnote K recording events with empty targets}} The \'A2empty target\'A2 is a variant of the phony target; it is used to hold commands for an action that you request explicitly from time to time.  Unlike a phony target, this target file can really exist; but the file's contents do not matter, and usually are empty.\par
\par
\pard{}The purpose of the empty target file is to record, with its last-modification time, when the rule's commands were last executed.  It does so because one of the commands is a {\f1{}touch} command to update the target file.\par
\par
\pard{}The empty target file should have some prerequisites (otherwise it doesn't make sense).  When you ask to remake the empty target, the commands are executed if any prerequisite is more recent than the target; in other words, if a prerequisite has changed since the last time you remade the target.  Here is an example:\par
\par
{\pard\keep\li720\f1{}print: foo.c bar.c\line
        lpr -p $?\line
        touch print\par
\pard\f0{}}{K{\footnote K {\f1{}print} target}}{K{\footnote K {\f1{}lpr} (shell command)}}{K{\footnote K {\f1{}touch} (shell command)}}\par
\par
\pard{}With this rule, {\f1{}make print} will execute the {\f1{}lpr} command if either source file has changed since the last {\f1{}make print}.  The automatic variable {\f1{}$?} is used to print only those files that have changed (see {\uldb Automatic Variables}{\v Automatic}).\par
\par
\page\pard Node: {\b Special Targets}, \keepn Next: {\uldb Multiple Targets}{\v Multiple_Targets}, Prev: {\uldb Empty Targets}{\v Empty_Targets}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Special Targets}
#{\footnote Special_Targets}
${\footnote \pard{}Special Built-in Target Names}\par
\pard{\fs24\b Special Built-in Target Names}\par
\par
\pard{}{K{\footnote K special targets}}{K{\footnote K built-in special targets}}{K{\footnote K targets, built-in special}} Certain names have special meanings if they appear as targets.\par
\par
{\pard\li720{}{K{\footnote K .PHONY}}\par
\par
\pard{}{\f1{}.PHONY}\par
\pard\li720{}The prerequisites of the special target {\f1{}.PHONY} are considered to be phony targets.  When it is time to consider such a target, {\f1{}make} will run its commands unconditionally, regardless of whether a file with that name exists or what its last-modification time is.  See {\uldb Phony Targets}{\v Phony_Targets}.\par
\par
\pard\li720{}{K{\footnote K .SUFFIXES}}\par
\par
\pard{}{\f1{}.SUFFIXES}\par
\pard\li720{}The prerequisites of the special target {\f1{}.SUFFIXES} are the list of suffixes to be used in checking for suffix rules.  See {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}.\par
\par
\pard\li720{}{K{\footnote K .DEFAULT}}\par
\par
\pard{}{\f1{}.DEFAULT}\par
\pard\li720{}The commands specified for {\f1{}.DEFAULT} are used for any target for which no rules are found (either explicit rules or implicit rules).  See {\uldb Last Resort}{\v Last_Resort}.  If {\f1{}.DEFAULT} commands are specified, every file mentioned as a prerequisite, but not as a target in a rule, will have these commands executed on its behalf.  See {\uldb Implicit Rule Search Algorithm}{\v Implicit_Rule_Search}.\par
\par
\pard\li720{}{K{\footnote K .PRECIOUS}}\par
\par
\pard{}{\f1{}.PRECIOUS}\par
\pard\li720{}{K{\footnote K precious targets}}{K{\footnote K preserving with {\f1{}.PRECIOUS}}} The targets which {\f1{}.PRECIOUS} depends on are given the following special treatment: if {\f1{}make} is killed or interrupted during the execution of their commands, the target is not deleted.  See {\uldb Interrupting or Killing {\f1{}make}}{\v Interrupts}.  Also, if the target is an intermediate file, it will not be deleted after it is no longer needed, as is normally done.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
\pard\li720{}You can also list the target pattern of an implicit rule (such as {\f1{}%.o}) as a prerequisite file of the special target {\f1{}.PRECIOUS} to preserve intermediate files created by rules whose target patterns match that file's name.\par
\par
\pard\li720{}{K{\footnote K .INTERMEDIATE}}\par
\par
\pard{}{\f1{}.INTERMEDIATE}\par
\pard\li720{}{K{\footnote K intermediate targets, explicit}} The targets which {\f1{}.INTERMEDIATE} depends on are treated as intermediate files.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.  {\f1{}.INTERMEDIATE} with no prerequisites has no effect.\par
\par
\pard\li720{}{K{\footnote K .SECONDARY}}\par
\par
\pard{}{\f1{}.SECONDARY}\par
\pard\li720{}{K{\footnote K secondary targets}}{K{\footnote K preserving with {\f1{}.SECONDARY}}} The targets which {\f1{}.SECONDARY} depends on are treated as intermediate files, except that they are never automatically deleted.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
{\f1{}\pard\li720{}.SECONDARY} with no prerequisites marks all file targets mentioned in the makefile as secondary.\par
\par
\pard\li720{}{K{\footnote K .DELETE_ON_ERROR}}\par
\par
\pard{}{\f1{}.DELETE_ON_ERROR}\par
\pard\li720{}{K{\footnote K removing targets on failure}} If {\f1{}.DELETE_ON_ERROR} is mentioned as a target anywhere in the makefile, then {\f1{}make} will delete the target of a rule if it has changed and its commands exit with a nonzero exit status, just as it does when it receives a signal.  See {\uldb Errors in Commands}{\v Errors}.\par
\par
\pard\li720{}{K{\footnote K .IGNORE}}\par
\par
\pard{}{\f1{}.IGNORE}\par
\pard\li720{}If you specify prerequisites for {\f1{}.IGNORE}, then {\f1{}make} will ignore errors in execution of the commands run for those particular files.  The commands for {\f1{}.IGNORE} are not meaningful.\par
\par
\pard\li720{}If mentioned as a target with no prerequisites, {\f1{}.IGNORE} says to ignore errors in execution of commands for all files.  This usage of {\f1{}.IGNORE} is supported only for historical compatibility.  Since this affects every command in the makefile, it is not very useful; we recommend you use the more selective ways to ignore errors in specific commands.  See {\uldb Errors in Commands}{\v Errors}.\par
\par
\pard\li720{}{K{\footnote K .SILENT}}\par
\par
\pard{}{\f1{}.SILENT}\par
\pard\li720{}If you specify prerequisites for {\f1{}.SILENT}, then {\f1{}make} will not print the commands to remake those particular files before executing them.  The commands for {\f1{}.SILENT} are not meaningful.\par
\par
\pard\li720{}If mentioned as a target with no prerequisites, {\f1{}.SILENT} says not to print any commands before executing them.  This usage of {\f1{}.SILENT} is supported only for historical compatibility.  We recommend you use the more selective ways to silence specific commands.  See {\uldb Command Echoing}{\v Echoing}.  If you want to silence all commands for a particular run of {\f1{}make}, use the {\f1{}-s} or {\f1{}--silent} option (see {\uldb Options Summary}{\v Options_Summary}).\par
\par
\pard\li720{}{K{\footnote K .EXPORT_ALL_VARIABLES}}\par
\par
\pard{}{\f1{}.EXPORT_ALL_VARIABLES}\par
\pard\li720{}Simply by being mentioned as a target, this tells {\f1{}make} to export all variables to child processes by default.  See {\uldb Communicating Variables to a\'5Cline Sub-{\f1{}make}}{\v Variables_Recursion}.\par
\pard{}}\par
\pard{}Any defined implicit rule suffix also counts as a special target if it appears as a target, and so does the concatenation of two suffixes, such as {\f1{}.c.o}.  These targets are suffix rules, an obsolete way of defining implicit rules (but a way still widely used).  In principle, any target name could be special in this way if you break it in two and add both pieces to the suffix list.  In practice, suffixes normally begin with {\f1{}.}, so these special target names also begin with {\f1{}.}.  See {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}.\par
\par
\page\pard Node: {\b Multiple Targets}, \keepn Next: {\uldb Multiple Rules}{\v Multiple_Rules}, Prev: {\uldb Special Targets}{\v Special_Targets}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Multiple Targets}
#{\footnote Multiple_Targets}
${\footnote \pard{}Multiple Targets in a Rule}\par
\pard{\fs24\b Multiple Targets in a Rule}\par
\par
\pard{}{K{\footnote K multiple targets}}{K{\footnote K several targets in a rule}}{K{\footnote K targets, multiple}}{K{\footnote K rule, with multiple targets}} A rule with multiple targets is equivalent to writing many rules, each with one target, and all identical aside from that.  The same commands apply to all the targets, but their effects may vary because you can substitute the actual target name into the command using {\f1{}$@}.  The rule contributes the same prerequisites to all the targets also.\par
\par
\pard{}This is useful in two cases.\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}You want just prerequisites, no commands.  For example:\par
\par
{\pard\keep\li1440\f1{}kbd.o command.o files.o: command.h\par
\pard\li720\f0{}}\par
\pard\li720{}gives an additional prerequisite to each of the three object files mentioned.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Similar commands work for all the targets.  The commands do not need to be absolutely identical, since the automatic variable {\f1{}$@} can be used to substitute the particular target to be remade into the commands (see {\uldb Automatic Variables}{\v Automatic}).  For example:\par
\par
{{\pard\keep\li1440\f1{}bigoutput littleoutput : text.g\line
        generate text.g -$(subst output,,$@) > $@\par
\pard\keep\li1440{}}}{K{\footnote K subst}}\par
\par
\pard\li720\f0{}is equivalent to\par
\par
{\pard\keep\li1440\f1{}bigoutput : text.g\line
        generate text.g -big > bigoutput\line
littleoutput : text.g\line
        generate text.g -little > littleoutput\par
\pard\li720\f0{}}\par
\pard\li720{}Here we assume the hypothetical program {\f1{}generate} makes two types of output, one if given {\f1{}-big} and one if given {\f1{}-little}.  See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}, for an explanation of the {\f1{}subst} function.\par
\pard{}}\par
\pard{}Suppose you would like to vary the prerequisites according to the target, much as the variable {\f1{}$@} allows you to vary the commands.  You cannot do this with multiple targets in an ordinary rule, but you can do it with a \'A2static pattern rule\'A2.  See {\uldb Static Pattern Rules}{\v Static_Pattern}.\par
\par
\page\pard Node: {\b Multiple Rules}, \keepn Next: {\uldb Static Pattern}{\v Static_Pattern}, Prev: {\uldb Multiple Targets}{\v Multiple_Targets}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Multiple Rules}
#{\footnote Multiple_Rules}
${\footnote \pard{}Multiple Rules for One Target}\par
\pard{\fs24\b Multiple Rules for One Target}\par
\par
\pard{}{K{\footnote K multiple rules for one target}}{K{\footnote K several rules for one target}}{K{\footnote K rule, multiple for one target}}{K{\footnote K target, multiple rules for one}} One file can be the target of several rules.  All the prerequisites mentioned in all the rules are merged into one list of prerequisites for the target.  If the target is older than any prerequisite from any rule, the commands are executed.\par
\par
\pard{}There can only be one set of commands to be executed for a file.  If more than one rule gives commands for the same file, {\f1{}make} uses the last set given and prints an error message.  (As a special case, if the file's name begins with a dot, no error message is printed.  This odd behavior is only for compatibility with other implementations of {\f1{}make}.)  There is no reason to write your makefiles this way; that is why {\f1{}make} gives you an error message.\par
\par
\pard{}An extra rule with just prerequisites can be used to give a few extra prerequisites to many files at once.  For example, one usually has a variable named {\f1{}objects} containing a list of all the compiler output files in the system being made.  An easy way to say that all of them must be recompiled if {\f1{}config.h} changes is to write the following:\par
\par
{\pard\keep\li720\f1{}objects = foo.o bar.o\line
foo.o : defs.h\line
bar.o : defs.h test.h\line
$(objects) : config.h\par
\pard\f0{}}\par
\pard{}This could be inserted or taken out without changing the rules that really specify how to make the object files, making it a convenient form to use if you wish to add the additional prerequisite intermittently.\par
\par
\pard{}Another wrinkle is that the additional prerequisites could be specified with a variable that you set with a command argument to {\f1{}make} (see {\uldb Overriding Variables}{\v Overriding}).  For example,\par
\par
{{\pard\keep\li720\f1{}extradeps=\line
$(objects) : $(extradeps)\par
\pard\keep\li720{}}}\par
\pard\f0{}means that the command {\f1{}make extradeps=foo.h} will consider {\f1{}foo.h} as a prerequisite of each object file, but plain {\f1{}make} will not.\par
\par
\pard{}If none of the explicit rules for a target has commands, then {\f1{}make} searches for an applicable implicit rule to find some commands see {\uldb Using Implicit Rules}{\v Implicit_Rules}).\par
\par
\page\pard Node: {\b Static Pattern}, \keepn Next: {\uldb Double-Colon}{\v Double_Colon}, Prev: {\uldb Multiple Rules}{\v Multiple_Rules}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Static Pattern}
#{\footnote Static_Pattern}
${\footnote \pard{}Static Pattern Rules}\par
\pard{\fs24\b Static Pattern Rules}\par
\par
\pard{}{K{\footnote K static pattern rule}}{K{\footnote K rule, static pattern}}{K{\footnote K pattern rules, static (not implicit)}}{K{\footnote K varying prerequisites}}{K{\footnote K prerequisites, varying (static pattern)}} \'A2Static pattern rules\'A2 are rules which specify multiple targets and construct the prerequisite names for each target based on the target name.  They are more general than ordinary rules with multiple targets because the targets do not have to have identical prerequisites.  Their prerequisites must be {\i analogous}, but not necessarily {\i identical}.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Static Usage}{\v Static_Usage}\tab The syntax of static pattern rules.\par
{\uldb Static versus Implicit}{\v Static_versus_Implicit}\tab When are they better than implicit rules?\par
\pard{}}\par
\page\pard Node: {\b Static Usage}, \keepn Next: {\uldb Static versus Implicit}{\v Static_versus_Implicit}, Prev: {\uldb }{\v }, Up: {\uldb Static Pattern}{\v Static_Pattern}\line
K{\footnote K Static Usage}
#{\footnote Static_Usage}
${\footnote \pard{}Syntax of Static Pattern Rules}\par
\pard{\fs24\b Syntax of Static Pattern Rules}\par
\par
\pard{}{K{\footnote K static pattern rule, syntax of}}{K{\footnote K pattern rules, static, syntax of}} Here is the syntax of a static pattern rule:\par
\par
{{\i \pard\li720\f1{}targets} ...: {\i target-pattern}: {\i dep-patterns} ...\line
        {\i commands}\line
        ...\par
\pard\f0{}}\par
\pard{}The {\i targets} list specifies the targets that the rule applies to.  The targets can contain wildcard characters, just like the targets of ordinary rules (see {\uldb Using Wildcard Characters in File Names}{\v Wildcards}).\par
\par
\pard{}{K{\footnote K target pattern, static (not implicit)}}{K{\footnote K stem}}The {\i target-pattern} and {\i dep-patterns} say how to compute the prerequisites of each target.  Each target is matched against the {\i target-pattern} to extract a part of the target name, called the \'A2stem\'A2.  This stem is substituted into each of the {\i dep-patterns} to make the prerequisite names (one from each {\i dep-pattern}).\par
\par
\pard{}Each pattern normally contains the character {\f1{}%} just once.  When the {\i target-pattern} matches a target, the {\f1{}%} can match any part of the target name; this part is called the \'A2stem\'A2.  The rest of the pattern must match exactly.  For example, the target {\f1{}foo.o} matches the pattern {\f1{}%.o}, with {\f1{}foo} as the stem.  The targets {\f1{}foo.c} and {\f1{}foo.out} do not match that pattern.\par
\par
\pard{}{K{\footnote K prerequisite pattern, static (not implicit)}}The prerequisite names for each target are made by substituting the stem for the {\f1{}%} in each prerequisite pattern.  For example, if one prerequisite pattern is {\f1{}%.c}, then substitution of the stem {\f1{}foo} gives the prerequisite name {\f1{}foo.c}.  It is legitimate to write a prerequisite pattern that does not contain {\f1{}%}; then this prerequisite is the same for all targets.\par
\par
\pard{}{K{\footnote K {\f1{}%}, quoting in static pattern}}{K{\footnote K {\f1{}%}, quoting with {\f1{}\'5C} (backslash)}}{K{\footnote K {\f1{}\'5C} (backslash), to quote {\f1{}%}}}{K{\footnote K backslash ({\f1{}\'5C}), to quote {\f1{}%}}}{K{\footnote K quoting {\f1{}%}, in static pattern}}{\f1{}%} characters in pattern rules can be quoted with preceding backslashes ({\f1{}\'5C}).  Backslashes that would otherwise quote {\f1{}%} characters can be quoted with more backslashes.  Backslashes that quote {\f1{}%} characters or other backslashes are removed from the pattern before it is compared to file names or has a stem substituted into it.  Backslashes that are not in danger of quoting {\f1{}%} characters go unmolested.  For example, the pattern {\f1{}the\'5C%weird\'5C\'5C%pattern\'5C\'5C} has {\f1{}the%weird\'5C} preceding the operative {\f1{}%} character, and {\f1{}pattern\'5C\'5C} following it.  The final two backslashes are left alone because they cannot affect any {\f1{}%} character.\par
\par
\pard{}Here is an example, which compiles each of {\f1{}foo.o} and {\f1{}bar.o} from the corresponding {\f1{}.c} file:\par
\par
{{\pard\keep\li720\f1{}objects = foo.o bar.o\line
\line
all: $(objects)\line
\line
$(objects): %.o: %.c\line
        $(CC) -c $(CFLAGS) $< -o $@\par
\pard\keep\li720{}}}\par
\pard\f0{}Here {\f1{}$<} is the automatic variable that holds the name of the prerequisite and {\f1{}$@} is the automatic variable that holds the name of the target; see {\uldb Automatic Variables}{\v Automatic}.\par
\par
\pard{}Each target specified must match the target pattern; a warning is issued for each target that does not.  If you have a list of files, only some of which will match the pattern, you can use the {\f1{}filter} function to remove nonmatching file names (see {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}):\par
\par
{\pard\keep\li720\f1{}files = foo.elc bar.o lose.o\line
\line
$(filter %.o,$(files)): %.o: %.c\line
        $(CC) -c $(CFLAGS) $< -o $@\line
$(filter %.elc,$(files)): %.elc: %.el\line
        emacs -f batch-byte-compile $<\par
\pard\f0{}}\par
\pard{}In this example the result of {\f1{}$(filter %.o,$(files))} is {\f1{}bar.o lose.o}, and the first static pattern rule causes each of these object files to be updated by compiling the corresponding C source file.  The result of {\f1{}$(filter %.elc,$(files))} is {\f1{}foo.elc}, so that file is made from {\f1{}foo.el}.\par
\par
\pard{}Another example shows how to use {\f1{}$*} in static pattern rules: {K{\footnote K $*, and static pattern}} {\par
{\pard\keep\li720\f1{}bigoutput littleoutput : %output : text.g\line
        generate text.g -$* > $@\par
\pard\keep\li720{}}}\par
\pard\f0{}When the {\f1{}generate} command is run, {\f1{}$*} will expand to the stem, either {\f1{}big} or {\f1{}little}.\par
\par
\page\pard Node: {\b Static versus Implicit}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Static Usage}{\v Static_Usage}, Up: {\uldb Static Pattern}{\v Static_Pattern}\line
K{\footnote K Static versus Implicit}
#{\footnote Static_versus_Implicit}
${\footnote \pard{}Static Pattern Rules versus Implicit Rules}\par
\pard{\fs24\b Static Pattern Rules versus Implicit Rules}\par
\par
\pard{}{K{\footnote K rule, static pattern versus implicit}}{K{\footnote K static pattern rule, versus implicit}} A static pattern rule has much in common with an implicit rule defined as a pattern rule (see {\uldb Defining and Redefining Pattern Rules}{\v Pattern_Rules}).  Both have a pattern for the target and patterns for constructing the names of prerequisites.  The difference is in how {\f1{}make} decides {\i when} the rule applies.\par
\par
\pard{}An implicit rule {\i can} apply to any target that matches its pattern, but it {\i does} apply only when the target has no commands otherwise specified, and only when the prerequisites can be found.  If more than one implicit rule appears applicable, only one applies; the choice depends on the order of rules.\par
\par
\pard{}By contrast, a static pattern rule applies to the precise list of targets that you specify in the rule.  It cannot apply to any other target and it invariably does apply to each of the targets specified.  If two conflicting rules apply, and both have commands, that's an error.\par
\par
\pard{}The static pattern rule can be better than an implicit rule for these reasons:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}You may wish to override the usual implicit rule for a few files whose names cannot be categorized syntactically but can be given in an explicit list.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}If you cannot be sure of the precise contents of the directories you are using, you may not be sure which other irrelevant files might lead {\f1{}make} to use the wrong implicit rule.  The choice might depend on the order in which the implicit rule search is done.  With static pattern rules, there is no uncertainty: each rule applies to precisely the targets specified.\par
\pard{}}\par
\page\pard Node: {\b Double-Colon}, \keepn Next: {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}, Prev: {\uldb Static Pattern}{\v Static_Pattern}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Double-Colon}
#{\footnote Double_Colon}
${\footnote \pard{}Double-Colon Rules}\par
\pard{\fs24\b Double-Colon Rules}\par
\par
\pard{}{K{\footnote K double-colon rules}}{K{\footnote K rule, double-colon ({\f1{}::})}}{K{\footnote K multiple rules for one target ({\f1{}::})}}{K{\footnote K {\f1{}::} rules (double-colon)}} \'A2Double-colon\'A2 rules are rules written with {\f1{}::} instead of {\f1{}:} after the target names.  They are handled differently from ordinary rules when the same target appears in more than one rule.\par
\par
\pard{}When a target appears in multiple rules, all the rules must be the same type: all ordinary, or all double-colon.  If they are double-colon, each of them is independent of the others.  Each double-colon rule's commands are executed if the target is older than any prerequisites of that rule.  This can result in executing none, any, or all of the double-colon rules.\par
\par
\pard{}Double-colon rules with the same target are in fact completely separate from one another.  Each double-colon rule is processed individually, just as rules with different targets are processed.\par
\par
\pard{}The double-colon rules for a target are executed in the order they appear in the makefile.  However, the cases where double-colon rules really make sense are those where the order of executing the commands would not matter.\par
\par
\pard{}Double-colon rules are somewhat obscure and not often very useful; they provide a mechanism for cases in which the method used to update a target differs depending on which prerequisite files caused the update, and such cases are rare.\par
\par
\pard{}Each double-colon rule should specify commands; if it does not, an implicit rule will be used if one applies.  See {\uldb Using Implicit Rules}{\v Implicit_Rules}.\par
\par
\page\pard Node: {\b Automatic Prerequisites}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Double-Colon}{\v Double_Colon}, Up: {\uldb Rules}{\v Rules}\line
K{\footnote K Automatic Prerequisites}
#{\footnote Automatic_Prerequisites}
${\footnote \pard{}Generating Prerequisites Automatically}\par
\pard{\fs24\b Generating Prerequisites Automatically}\par
\par
\pard{}{K{\footnote K prerequisites, automatic generation}}{K{\footnote K automatic generation of prerequisites}}{K{\footnote K generating prerequisites automatically}} In the makefile for a program, many of the rules you need to write often say only that some object file depends on some header file.  For example, if {\f1{}main.c} uses {\f1{}defs.h} via an {\f1{}#include}, you would write:\par
\par
{\pard\keep\li720\f1{}main.o: defs.h\par
\pard\f0{}}\par
\pard{}You need this rule so that {\f1{}make} knows that it must remake {\f1{}main.o} whenever {\f1{}defs.h} changes.  You can see that for a large program you would have to write dozens of such rules in your makefile.  And, you must always be very careful to update the makefile every time you add or remove an {\f1{}#include}.  {K{\footnote K {\f1{}#include}}} {K{\footnote K {\f1{}-M} (to compiler)}}To avoid this hassle, most modern C compilers can write these rules for you, by looking at the {\f1{}#include} lines in the source files.  Usually this is done with the {\f1{}-M} option to the compiler.  For example, the command:\par
\par
{\pard\keep\li720\f1{}cc -M main.c\par
\pard\f0{}}\par
\pard{}generates the output:\par
\par
{\pard\keep\li720\f1{}main.o : main.c defs.h\par
\pard\f0{}}\par
\pard{}Thus you no longer have to write all those rules yourself.  The compiler will do it for you.\par
\par
\pard{}Note that such a prerequisite constitutes mentioning {\f1{}main.o} in a makefile, so it can never be considered an intermediate file by implicit rule search.  This means that {\f1{}make} won't ever remove the file after using it; see {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
\pard{}{K{\footnote K {\f1{}make depend}}}With old {\f1{}make} programs, it was traditional practice to use this compiler feature to generate prerequisites on demand with a command like {\f1{}make depend}.  That command would create a file {\f1{}depend} containing all the automatically-generated prerequisites; then the makefile could use {\f1{}include} to read them in (see {\uldb Include}{\v Include}).\par
\par
\pard{}In GNU {\f1{}make}, the feature of remaking makefiles makes this practice obsolete--you need never tell {\f1{}make} explicitly to regenerate the prerequisites, because it always regenerates any makefile that is out of date.  See {\uldb Remaking Makefiles}{\v Remaking_Makefiles}.\par
\par
\pard{}The practice we recommend for automatic prerequisite generation is to have one makefile corresponding to each source file.  For each source file {\f1{}{\i name}.c} there is a makefile {\f1{}{\i name}.d} which lists what files the object file {\f1{}{\i name}.o} depends on.  That way only the source files that have changed need to be rescanned to produce the new prerequisites.\par
\par
\pard{}Here is the pattern rule to generate a file of prerequisites (i.e., a makefile) called {\f1{}{\i name}.d} from a C source file called {\f1{}{\i name}.c}:\par
\par
{{\pard\keep\li720\f1{}%.d: %.c\line
        set -e; $(CC) -M $(CPPFLAGS) $< \'5C\line
                  | sed 's/\'5C($*\'5C)\'5C.o[ :]*/\'5C1.o $@ : /g' > $@; \'5C\line
                [ -s $@ ] || rm -f $@\par
\pard\keep\li720{}}}\par
\pard\f0{}See {\uldb Pattern Rules}{\v Pattern_Rules}, for information on defining pattern rules.  The {\f1{}-e} flag to the shell makes it exit immediately if the {\f1{}$(CC)} command fails (exits with a nonzero status).  Normally the shell exits with the status of the last command in the pipeline ({\f1{}sed} in this case), so {\f1{}make} would not notice a nonzero status from the compiler.  {K{\footnote K {\f1{}-e} (shell flag)}} {K{\footnote K {\f1{}-MM} (to GNU compiler)}}With the GNU C compiler, you may wish to use the {\f1{}-MM} flag instead of {\f1{}-M}.  This omits prerequisites on system header files.  See {\uldb Options Controlling the Preprocessor}{\v Preprocessor_Options @gcc.hlp}, for details.\par
\par
\pard{}{K{\footnote K {\f1{}sed} (shell command)}}The purpose of the {\f1{}sed} command is to translate (for example):\par
\par
{\pard\keep\li720\f1{}main.o : main.c defs.h\par
\pard\f0{}}\par
\pard{}into:\par
\par
{\pard\keep\li720\f1{}main.o main.d : main.c defs.h\par
\pard\f0{}}\par
\pard{}{K{\footnote K {\f1{}.d}}}This makes each {\f1{}.d} file depend on all the source and header files that the corresponding {\f1{}.o} file depends on.  {\f1{}make} then knows it must regenerate the prerequisites whenever any of the source or header files changes.\par
\par
\pard{}Once you've defined the rule to remake the {\f1{}.d} files, you then use the {\f1{}include} directive to read them all in.  See {\uldb Include}{\v Include}.  For example:\par
\par
{{\pard\keep\li720\f1{}sources = foo.c bar.c\line
\line
include $(sources:.c=.d)\par
\pard\keep\li720{}}}\par
\pard\f0{}(This example uses a substitution variable reference to translate the list of source files {\f1{}foo.c bar.c} into a list of prerequisite makefiles, {\f1{}foo.d bar.d}.  See {\uldb Substitution Refs}{\v Substitution_Refs}, for full information on substitution references.)  Since the {\f1{}.d} files are makefiles like any others, {\f1{}make} will remake them as necessary with no further work from you.  See {\uldb Remaking Makefiles}{\v Remaking_Makefiles}.\par
\par
\page\pard Node: {\b Commands}, \keepn Next: {\uldb Using Variables}{\v Using_Variables}, Prev: {\uldb Rules}{\v Rules}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Commands}
#{\footnote Commands}
${\footnote \pard{}Writing the Commands in Rules}\par
\pard{\fs24\b Writing the Commands in Rules}\par
\par
\pard{}{K{\footnote K commands, how to write}}{K{\footnote K rule commands}}{K{\footnote K writing rule commands}} The commands of a rule consist of shell command lines to be executed one by one.  Each command line must start with a tab, except that the first command line may be attached to the target-and-prerequisites line with a semicolon in between.  Blank lines and lines of just comments may appear among the command lines; they are ignored.  (But beware, an apparently "blank" line that begins with a tab is {\i not} blank!  It is an empty command; see {\uldb Empty Commands}{\v Empty_Commands}.)\par
\par
\pard{}Users use many different shell programs, but commands in makefiles are always interpreted by {\f1{}/bin/sh} unless the makefile specifies otherwise.  See {\uldb Command Execution}{\v Execution}.\par
\par
\pard{}{K{\footnote K comments, in commands}}{K{\footnote K commands, comments in}}{K{\footnote K {\f1{}#} (comments), in commands}}The shell that is in use determines whether comments can be written on command lines, and what syntax they use.  When the shell is {\f1{}/bin/sh}, a {\f1{}#} starts a comment that extends to the end of the line.  The {\f1{}#} does not have to be at the beginning of a line.  Text on a line before a {\f1{}#} is not part of the comment.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Echoing}{\v Echoing}\tab How to control when commands are echoed.\par
{\uldb Execution}{\v Execution}\tab How commands are executed.\par
{\uldb Parallel}{\v Parallel}\tab How commands can be executed in parallel.\par
{\uldb Errors}{\v Errors}\tab What happens after a command execution error.\par
{\uldb Interrupts}{\v Interrupts}\tab What happens when a command is interrupted.\par
{\uldb Recursion}{\v Recursion}\tab Invoking {\f1{}make} from makefiles.\par
{\uldb Sequences}{\v Sequences}\tab Defining canned sequences of commands.\par
{\uldb Empty Commands}{\v Empty_Commands}\tab Defining useful, do-nothing commands.\par
\pard{}}\par
\page\pard Node: {\b Echoing}, \keepn Next: {\uldb Execution}{\v Execution}, Prev: {\uldb }{\v }, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Echoing}
#{\footnote Echoing}
${\footnote \pard{}Command Echoing}\par
\pard{\fs24\b Command Echoing}\par
\par
\pard{}{K{\footnote K echoing of commands}}{K{\footnote K silent operation}}{K{\footnote K {\f1{}@} (in commands)}}{K{\footnote K commands, echoing}}{K{\footnote K printing of commands}} Normally {\f1{}make} prints each command line before it is executed.  We call this \'A2echoing\'A2 because it gives the appearance that you are typing the commands yourself.\par
\par
\pard{}When a line starts with {\f1{}@}, the echoing of that line is suppressed.  The {\f1{}@} is discarded before the command is passed to the shell.  Typically you would use this for a command whose only effect is to print something, such as an {\f1{}echo} command to indicate progress through the makefile:\par
\par
{\pard\keep\li720\f1{}@echo About to make distribution files\par
\pard\f0{}}\par
\pard{}{K{\footnote K {\f1{}-n}}}{K{\footnote K {\f1{}--just-print}}}{K{\footnote K {\f1{}--dry-run}}}{K{\footnote K {\f1{}--recon}}}When {\f1{}make} is given the flag {\f1{}-n} or {\f1{}--just-print} it only echoes commands, it won't execute them.  See {\uldb Summary of Options}{\v Options_Summary}.  In this case and only this case, even the commands starting with {\f1{}@} are printed.  This flag is useful for finding out which commands {\f1{}make} thinks are necessary without actually doing them.\par
\par
\pard{}{K{\footnote K {\f1{}-s}}}{K{\footnote K {\f1{}--silent}}}{K{\footnote K {\f1{}--quiet}}}{K{\footnote K .SILENT}}The {\f1{}-s} or {\f1{}--silent} flag to {\f1{}make} prevents all echoing, as if all commands started with {\f1{}@}.  A rule in the makefile for the special target {\f1{}.SILENT} without prerequisites has the same effect (see {\uldb Special Built-in Target Names}{\v Special_Targets}).  {\f1{}.SILENT} is essentially obsolete since {\f1{}@} is more flexible.\par
\par
\page\pard Node: {\b Execution}, \keepn Next: {\uldb Parallel}{\v Parallel}, Prev: {\uldb Echoing}{\v Echoing}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Execution}
#{\footnote Execution}
${\footnote \pard{}Command Execution}\par
\pard{\fs24\b Command Execution}\par
\par
\pard{}{K{\footnote K commands, execution}}{K{\footnote K execution, of commands}}{K{\footnote K shell command, execution}}{K{\footnote K SHELL (command execution)}} When it is time to execute commands to update a target, they are executed by making a new subshell for each line.  (In practice, {\f1{}make} may take shortcuts that do not affect the results.)\par
\par
\pard{}{K{\footnote K {\f1{}cd} (shell command)}}{\b Please note:} this implies that shell commands such as {\f1{}cd} that set variables local to each process will not affect the following command lines. ({\ul 1}{\v Execution_1})  If you want to use {\f1{}cd} to affect the next command, put the two on a single line with a semicolon between them.  Then {\f1{}make} will consider them a single command and pass them, together, to a shell which will execute them in sequence.  For example:\par
\par
{\pard\keep\li720\f1{}foo : bar/lose\line
        cd bar; gobble lose > ../foo\par
\pard\f0{}}\par
\pard{}{K{\footnote K commands, backslash ({\f1{}\'5C}) in}}{K{\footnote K commands, quoting newlines in}}{K{\footnote K backslash ({\f1{}\'5C}), in commands}}{K{\footnote K {\f1{}\'5C} (backslash), in commands}}{K{\footnote K quoting newline, in commands}}{K{\footnote K newline, quoting, in commands}}If you would like to split a single shell command into multiple lines of text, you must use a backslash at the end of all but the last subline.  Such a sequence of lines is combined into a single line, by deleting the backslash-newline sequences, before passing it to the shell.  Thus, the following is equivalent to the preceding example:\par
\par
{{\pard\keep\li720\f1{}foo : bar/lose\line
        cd bar;  \'5C\line
        gobble lose > ../foo\par
\pard\keep\li720{}}}\par
\pard\f0{}{K{\footnote K SHELL}}The program used as the shell is taken from the variable {\f1{}SHELL}.  By default, the program {\f1{}/bin/sh} is used.\par
\par
\pard{}{K{\footnote K COMSPEC}}On MS-DOS, if {\f1{}SHELL} is not set, the value of the variable {\f1{}COMSPEC} (which is always set) is used instead.\par
\par
\pard{}{K{\footnote K {\f1{}SHELL}, MS-DOS specifics}}The processing of lines that set the variable {\f1{}SHELL} in Makefiles is different on MS-DOS.  The stock shell, {\f1{}command.com}, is ridiculously limited in its functionality and many users of {\f1{}make} tend to install a replacement shell.  Therefore, on MS-DOS, {\f1{}make} examines the value of {\f1{}SHELL}, and changes its behavior based on whether it points to a Unix-style or DOS-style shell.  This allows reasonable functionality even if {\f1{}SHELL} points to {\f1{}command.com}.\par
\par
\pard{}If {\f1{}SHELL} points to a Unix-style shell, {\f1{}make} on MS-DOS additionally checks whether that shell can indeed be found; if not, it ignores the line that sets {\f1{}SHELL}.  In MS-DOS, GNU {\f1{}make} searches for the shell in the following places:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}1. \tab{}In the precise place pointed to by the value of {\f1{}SHELL}.  For example, if the makefile specifies {\f1{}SHELL = /bin/sh}, {\f1{}make} will look in the directory {\f1{}/bin} on the current drive.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}2. \tab{}In the current directory.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}3. \tab{}In each of the directories in the {\f1{}PATH} variable, in order.\par
\par
\pard{}}\par
\pard{}In every directory it examines, {\f1{}make} will first look for the specific file ({\f1{}sh} in the example above).  If this is not found, it will also look in that directory for that file with one of the known extensions which identify executable files.  For example {\f1{}.exe}, {\f1{}.com}, {\f1{}.bat}, {\f1{}.btm}, {\f1{}.sh}, and some others.\par
\par
\pard{}If any of these attempts is successful, the value of {\f1{}SHELL} will be set to the full pathname of the shell as found.  However, if none of these is found, the value of {\f1{}SHELL} will not be changed, and thus the line that sets it will be effectively ignored.  This is so {\f1{}make} will only support features specific to a Unix-style shell if such a shell is actually installed on the system where {\f1{}make} runs.\par
\par
\pard{}Note that this extended search for the shell is limited to the cases where {\f1{}SHELL} is set from the Makefile; if it is set in the environment or command line, you are expected to set it to the full pathname of the shell, exactly as things are on Unix.\par
\par
\pard{}The effect of the above DOS-specific processing is that a Makefile that says {\f1{}SHELL = /bin/sh} (as many Unix makefiles do), will work on MS-DOS unaltered if you have e.g. {\f1{}sh.exe} installed in some directory along your {\f1{}PATH}.\par
\par
\pard{}{K{\footnote K environment, {\f1{}SHELL} in}}Unlike most variables, the variable {\f1{}SHELL} is never set from the environment.  This is because the {\f1{}SHELL} environment variable is used to specify your personal choice of shell program for interactive use.  It would be very bad for personal choices like this to affect the functioning of makefiles.  See {\uldb Variables from the Environment}{\v Environment}.  However, on MS-DOS and MS-Windows the value of {\f1{}SHELL} in the environment {\b is} used, since on those systems most users do not set this variable, and therefore it is most likely set specifically to be used by {\f1{}make}.  On MS-DOS, if the setting of {\f1{}SHELL} is not suitable for {\f1{}make}, you can set the variable {\f1{}MAKESHELL} to the shell that {\f1{}make} should use; this will override the value of {\f1{}SHELL}.\par
\par
\page\pard#{\footnote Execution_1}
\pard{}(1) On MS-DOS, the value of current working directory is {\b global}, so changing it {\i will} affect the following command lines on those systems.\par
\par
\page\pard Node: {\b Parallel}, \keepn Next: {\uldb Errors}{\v Errors}, Prev: {\uldb Execution}{\v Execution}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Parallel}
#{\footnote Parallel}
${\footnote \pard{}Parallel Execution}\par
\pard{\fs24\b Parallel Execution}\par
\par
\pard{}{K{\footnote K commands, execution in parallel}}{K{\footnote K parallel execution}}{K{\footnote K execution, in parallel}}{K{\footnote K job slots}}{K{\footnote K {\f1{}-j}}}{K{\footnote K {\f1{}--jobs}}} GNU {\f1{}make} knows how to execute several commands at once.  Normally, {\f1{}make} will execute only one command at a time, waiting for it to finish before executing the next.  However, the {\f1{}-j} or {\f1{}--jobs} option tells {\f1{}make} to execute many commands simultaneously.\par
\par
\pard{}On MS-DOS, the {\f1{}-j} option has no effect, since that system doesn't support multi-processing.\par
\par
\pard{}If the {\f1{}-j} option is followed by an integer, this is the number of commands to execute at once; this is called the number of \'A2job slots\'A2.  If there is nothing looking like an integer after the {\f1{}-j} option, there is no limit on the number of job slots.  The default number of job slots is one, which means serial execution (one thing at a time).\par
\par
\pard{}One unpleasant consequence of running several commands simultaneously is that output generated by the commands appears whenever each command sends it, so messages from different commands may be interspersed.\par
\par
\pard{}Another problem is that two processes cannot both take input from the same device; so to make sure that only one command tries to take input from the terminal at once, {\f1{}make} will invalidate the standard input streams of all but one running command.  This means that attempting to read from standard input will usually be a fatal error (a {\f1{}Broken pipe} signal) for most child processes if there are several.  {K{\footnote K broken pipe}}{K{\footnote K standard input}} It is unpredictable which command will have a valid standard input stream (which will come from the terminal, or wherever you redirect the standard input of {\f1{}make}).  The first command run will always get it first, and the first command started after that one finishes will get it next, and so on.\par
\par
\pard{}We will change how this aspect of {\f1{}make} works if we find a better alternative.  In the mean time, you should not rely on any command using standard input at all if you are using the parallel execution feature; but if you are not using this feature, then standard input works normally in all commands.\par
\par
\pard{}Finally, handling recursive {\f1{}make} invocations raises issues.  For more information on this, see {\uldb Communicating Options to a Sub-{\f1{}make}}{\v Options_Recursion}.\par
\par
\pard{}If a command fails (is killed by a signal or exits with a nonzero status), and errors are not ignored for that command (see {\uldb Errors in Commands}{\v Errors}), the remaining command lines to remake the same target will not be run.  If a command fails and the {\f1{}-k} or {\f1{}--keep-going} option was not given (see {\uldb Summary of Options}{\v Options_Summary}), {\f1{}make} aborts execution.  If make terminates for any reason (including a signal) with child processes running, it waits for them to finish before actually exiting.\par
\par
\pard{}{K{\footnote K load average}}{K{\footnote K limiting jobs based on load}}{K{\footnote K jobs, limiting based on load}}{K{\footnote K {\f1{}-l} (load average)}}{K{\footnote K {\f1{}--max-load}}}{K{\footnote K {\f1{}--load-average}}}When the system is heavily loaded, you will probably want to run fewer jobs than when it is lightly loaded.  You can use the {\f1{}-l} option to tell {\f1{}make} to limit the number of jobs to run at once, based on the load average.  The {\f1{}-l} or {\f1{}--max-load} option is followed by a floating-point number.  For example,\par
\par
{\pard\keep\li720\f1{}-l 2.5\par
\pard\f0{}}\par
\pard{}will not let {\f1{}make} start more than one job if the load average is above 2.5.  The {\f1{}-l} option with no following number removes the load limit, if one was given with a previous {\f1{}-l} option.\par
\par
\pard{}More precisely, when {\f1{}make} goes to start up a job, and it already has at least one job running, it checks the current load average; if it is not lower than the limit given with {\f1{}-l}, {\f1{}make} waits until the load average goes below that limit, or until all the other jobs finish.\par
\par
\pard{}By default, there is no load limit.\par
\par
\page\pard Node: {\b Errors}, \keepn Next: {\uldb Interrupts}{\v Interrupts}, Prev: {\uldb Parallel}{\v Parallel}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Errors}
#{\footnote Errors}
${\footnote \pard{}Errors in Commands}\par
\pard{\fs24\b Errors in Commands}\par
\par
\pard{}{K{\footnote K errors (in commands)}}{K{\footnote K commands, errors in}}{K{\footnote K exit status (errors)}} After each shell command returns, {\f1{}make} looks at its exit status.  If the command completed successfully, the next command line is executed in a new shell; after the last command line is finished, the rule is finished.\par
\par
\pard{}If there is an error (the exit status is nonzero), {\f1{}make} gives up on the current rule, and perhaps on all rules.\par
\par
\pard{}Sometimes the failure of a certain command does not indicate a problem.  For example, you may use the {\f1{}mkdir} command to ensure that a directory exists.  If the directory already exists, {\f1{}mkdir} will report an error, but you probably want {\f1{}make} to continue regardless.\par
\par
\pard{}{K{\footnote K {\f1{}-} (in commands)}}To ignore errors in a command line, write a {\f1{}-} at the beginning of the line's text (after the initial tab).  The {\f1{}-} is discarded before the command is passed to the shell for execution.\par
\par
\pard{}For example,\par
\par
{{\pard\keep\li720\f1{}clean:\line
        -rm -f *.o\par
\pard\keep\li720{}}}{K{\footnote K {\f1{}rm} (shell command)}}\par
\par
\pard\f0{}This causes {\f1{}rm} to continue even if it is unable to remove a file.\par
\par
\pard{}{K{\footnote K {\f1{}-i}}}{K{\footnote K {\f1{}--ignore-errors}}}{K{\footnote K .IGNORE}}When you run {\f1{}make} with the {\f1{}-i} or {\f1{}--ignore-errors} flag, errors are ignored in all commands of all rules.  A rule in the makefile for the special target {\f1{}.IGNORE} has the same effect, if there are no prerequisites.  These ways of ignoring errors are obsolete because {\f1{}-} is more flexible.\par
\par
\pard{}When errors are to be ignored, because of either a {\f1{}-} or the {\f1{}-i} flag, {\f1{}make} treats an error return just like success, except that it prints out a message that tells you the status code the command exited with, and says that the error has been ignored.\par
\par
\pard{}When an error happens that {\f1{}make} has not been told to ignore, it implies that the current target cannot be correctly remade, and neither can any other that depends on it either directly or indirectly.  No further commands will be executed for these targets, since their preconditions have not been achieved.\par
\par
\pard{}{K{\footnote K {\f1{}-k}}}{K{\footnote K {\f1{}--keep-going}}}Normally {\f1{}make} gives up immediately in this circumstance, returning a nonzero status.  However, if the {\f1{}-k} or {\f1{}--keep-going} flag is specified, {\f1{}make} continues to consider the other prerequisites of the pending targets, remaking them if necessary, before it gives up and returns nonzero status.  For example, after an error in compiling one object file, {\f1{}make -k} will continue compiling other object files even though it already knows that linking them will be impossible.  See {\uldb Summary of Options}{\v Options_Summary}.\par
\par
\pard{}The usual behavior assumes that your purpose is to get the specified targets up to date; once {\f1{}make} learns that this is impossible, it might as well report the failure immediately.  The {\f1{}-k} option says that the real purpose is to test as many of the changes made in the program as possible, perhaps to find several independent problems so that you can correct them all before the next attempt to compile.  This is why Emacs' {\f1{}compile} command passes the {\f1{}-k} flag by default.  {K{\footnote K Emacs ({\f1{}M-x compile})}} {K{\footnote K .DELETE_ON_ERROR}}{K{\footnote K deletion of target files}}{K{\footnote K removal of target files}}{K{\footnote K target, deleting on error}}Usually when a command fails, if it has changed the target file at all, the file is corrupted and cannot be used--or at least it is not completely updated.  Yet the file's timestamp says that it is now up to date, so the next time {\f1{}make} runs, it will not try to update that file.  The situation is just the same as when the command is killed by a signal; see {\uldb Interrupts}{\v Interrupts}.  So generally the right thing to do is to delete the target file if the command fails after beginning to change the file.  {\f1{}make} will do this if {\f1{}.DELETE_ON_ERROR} appears as a target.  This is almost always what you want {\f1{}make} to do, but it is not historical practice; so for compatibility, you must explicitly request it.\par
\par
\page\pard Node: {\b Interrupts}, \keepn Next: {\uldb Recursion}{\v Recursion}, Prev: {\uldb Errors}{\v Errors}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Interrupts}
#{\footnote Interrupts}
${\footnote \pard{}Interrupting or Killing {\f1{}make}}\par
\pard{\fs24\b Interrupting or Killing {\f1{}make}}\par
\par
\pard{}{K{\footnote K interrupt}}{K{\footnote K signal}}{K{\footnote K deletion of target files}}{K{\footnote K removal of target files}}{K{\footnote K target, deleting on interrupt}}{K{\footnote K killing (interruption)}} If {\f1{}make} gets a fatal signal while a command is executing, it may delete the target file that the command was supposed to update.  This is done if the target file's last-modification time has changed since {\f1{}make} first checked it.\par
\par
\pard{}The purpose of deleting the target is to make sure that it is remade from scratch when {\f1{}make} is next run.  Why is this?  Suppose you type {\f1{}Ctrl-c} while a compiler is running, and it has begun to write an object file {\f1{}foo.o}.  The {\f1{}Ctrl-c} kills the compiler, resulting in an incomplete file whose last-modification time is newer than the source file {\f1{}foo.c}.  But {\f1{}make} also receives the {\f1{}Ctrl-c} signal and deletes this incomplete file.  If {\f1{}make} did not do this, the next invocation of {\f1{}make} would think that {\f1{}foo.o} did not require updating--resulting in a strange error message from the linker when it tries to link an object file half of which is missing.\par
\par
\pard{}{K{\footnote K .PRECIOUS}}You can prevent the deletion of a target file in this way by making the special target {\f1{}.PRECIOUS} depend on it.  Before remaking a target, {\f1{}make} checks to see whether it appears on the prerequisites of {\f1{}.PRECIOUS}, and thereby decides whether the target should be deleted if a signal happens.  Some reasons why you might do this are that the target is updated in some atomic fashion, or exists only to record a modification-time (its contents do not matter), or must exist at all times to prevent other sorts of trouble.\par
\par
\page\pard Node: {\b Recursion}, \keepn Next: {\uldb Sequences}{\v Sequences}, Prev: {\uldb Interrupts}{\v Interrupts}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Recursion}
#{\footnote Recursion}
${\footnote \pard{}Recursive Use of {\f1{}make}}\par
\pard{\fs24\b Recursive Use of {\f1{}make}}\par
\par
\pard{}{K{\footnote K recursion}}{K{\footnote K subdirectories, recursion for}} Recursive use of {\f1{}make} means using {\f1{}make} as a command in a makefile.  This technique is useful when you want separate makefiles for various subsystems that compose a larger system.  For example, suppose you have a subdirectory {\f1{}subdir} which has its own makefile, and you would like the containing directory's makefile to run {\f1{}make} on the subdirectory.  You can do it by writing this:\par
\par
{\pard\keep\li720\f1{}subsystem:\line
        cd subdir && $(MAKE)\par
\pard\f0{}}\par
\pard{}or, equivalently, this (see {\uldb Summary of Options}{\v Options_Summary}):\par
\par
{\pard\keep\li720\f1{}subsystem:\line
        $(MAKE) -C subdir\par
\pard\f0{}}{K{\footnote K {\f1{}-C}}}{K{\footnote K {\f1{}--directory}}} You can write recursive {\f1{}make} commands just by copying this example, but there are many things to know about how they work and why, and about how the sub-{\f1{}make} relates to the top-level {\f1{}make}.\par
\par
\pard{}For your convenience, GNU {\f1{}make} sets the variable {\f1{}CURDIR} to the pathname of the current working directory for you.  If {\f1{}-C} is in effect, it will contain the path of the new directory, not the original.  The value has the same precedence it would have if it were set in the makefile (by default, an environment variable {\f1{}CURDIR} will not override this value).  Note that setting this variable has no effect on the operation of {\f1{}make}\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb MAKE Variable}{\v MAKE_Variable}\tab The special effects of using {\f1{}$(MAKE)}.\par
{\uldb Variables/Recursion}{\v Variables_Recursion}\tab How to communicate variables to a sub-{\f1{}make}.\par
{\uldb Options/Recursion}{\v Options_Recursion}\tab How to communicate options to a sub-{\f1{}make}.\par
{\uldb -w Option}{\v _w_Option}\tab How the {\f1{}-w} or {\f1{}--print-directory} option helps debug use of recursive {\f1{}make} commands.\par
\pard{}}\par
\page\pard Node: {\b MAKE Variable}, \keepn Next: {\uldb Variables/Recursion}{\v Variables_Recursion}, Prev: {\uldb }{\v }, Up: {\uldb Recursion}{\v Recursion}\line
K{\footnote K MAKE Variable}
#{\footnote MAKE_Variable}
${\footnote \pard{}How the {\f1{}MAKE} Variable Works}\par
\pard{\fs24\b How the {\f1{}MAKE} Variable Works}\par
\par
\pard{}{K{\footnote K MAKE}}{K{\footnote K recursion, and {\f1{}MAKE} variable}} Recursive {\f1{}make} commands should always use the variable {\f1{}MAKE}, not the explicit command name {\f1{}make}, as shown here:\par
\par
{{\pard\keep\li720\f1{}subsystem:\line
        cd subdir && $(MAKE)\par
\pard\keep\li720{}}}\par
\pard\f0{}The value of this variable is the file name with which {\f1{}make} was invoked.  If this file name was {\f1{}/bin/make}, then the command executed is {\f1{}cd subdir && /bin/make}.  If you use a special version of {\f1{}make} to run the top-level makefile, the same special version will be executed for recursive invocations.  {K{\footnote K {\f1{}cd} (shell command)}} As a special feature, using the variable {\f1{}MAKE} in the commands of a rule alters the effects of the {\f1{}-t} ({\f1{}--touch}), {\f1{}-n} ({\f1{}--just-print}), or {\f1{}-q} ({\f1{}--question}) option.  Using the {\f1{}MAKE} variable has the same effect as using a {\f1{}+} character at the beginning of the command line.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\par
\pard{}Consider the command {\f1{}make -t} in the above example.  (The {\f1{}-t} option marks targets as up to date without actually running any commands; see {\uldb Instead of Execution}{\v Instead_of_Execution}.)  Following the usual definition of {\f1{}-t}, a {\f1{}make -t} command in the example would create a file named {\f1{}subsystem} and do nothing else.  What you really want it to do is run {\f1{}cd subdir && make -t}; but that would require executing the command, and {\f1{}-t} says not to execute commands.  {K{\footnote K {\f1{}-t}, and recursion}}{K{\footnote K recursion, and {\f1{}-t}}}{K{\footnote K {\f1{}--touch}, and recursion}} The special feature makes this do what you want: whenever a command line of a rule contains the variable {\f1{}MAKE}, the flags {\f1{}-t}, {\f1{}-n} and {\f1{}-q} do not apply to that line.  Command lines containing {\f1{}MAKE} are executed normally despite the presence of a flag that causes most commands not to be run.  The usual {\f1{}MAKEFLAGS} mechanism passes the flags to the sub-{\f1{}make} (see {\uldb Communicating Options to a\'5Cline Sub-{\f1{}make}}{\v Options_Recursion}), so your request to touch the files, or print the commands, is propagated to the subsystem.\par
\par
\page\pard Node: {\b Variables/Recursion}, \keepn Next: {\uldb Options/Recursion}{\v Options_Recursion}, Prev: {\uldb MAKE Variable}{\v MAKE_Variable}, Up: {\uldb Recursion}{\v Recursion}\line
K{\footnote K Variables/Recursion}
#{\footnote Variables_Recursion}
${\footnote \pard{}Communicating Variables to a Sub-{\f1{}make}}\par
\pard{\fs24\b Communicating Variables to a Sub-{\f1{}make}}\par
\par
\pard{}{K{\footnote K sub-{\f1{}make}}}{K{\footnote K environment, and recursion}}{K{\footnote K exporting variables}}{K{\footnote K variables, environment}}{K{\footnote K variables, exporting}}{K{\footnote K recursion, and environment}}{K{\footnote K recursion, and variables}} Variable values of the top-level {\f1{}make} can be passed to the sub-{\f1{}make} through the environment by explicit request.  These variables are defined in the sub-{\f1{}make} as defaults, but do not override what is specified in the makefile used by the sub-{\f1{}make} makefile unless you use the {\f1{}-e} switch (see {\uldb Summary of Options}{\v Options_Summary}).\par
\par
\pard{}To pass down, or \'A2export\'A2, a variable, {\f1{}make} adds the variable and its value to the environment for running each command.  The sub-{\f1{}make}, in turn, uses the environment to initialize its table of variable values.  See {\uldb Variables from the Environment}{\v Environment}.\par
\par
\pard{}Except by explicit request, {\f1{}make} exports a variable only if it is either defined in the environment initially or set on the command line, and if its name consists only of letters, numbers, and underscores.  Some shells cannot cope with environment variable names consisting of characters other than letters, numbers, and underscores.\par
\par
\pard{}The special variables {\f1{}SHELL} and {\f1{}MAKEFLAGS} are always exported (unless you unexport them).  {\f1{}MAKEFILES} is exported if you set it to anything.\par
\par
{\f1{}\pard{}make} automatically passes down variable values that were defined on the command line, by putting them in the {\f1{}MAKEFLAGS} variable.  {See {\uldb Options/Recursion}{\v Options_Recursion}.  }\par
\par
\pard{}Variables are {\i not} normally passed down if they were created by default by {\f1{}make} (see {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}).  The sub-{\f1{}make} will define these for itself.\par
\par
\pard{}{K{\footnote K export}}If you want to export specific variables to a sub-{\f1{}make}, use the {\f1{}export} directive, like this:\par
\par
{\pard\keep\li720\f1{}export {\i variable} ...\par
\pard\f0{}}\par
\pard{}{K{\footnote K unexport}}If you want to {\i prevent} a variable from being exported, use the {\f1{}unexport} directive, like this:\par
\par
{\pard\keep\li720\f1{}unexport {\i variable} ...\par
\pard\f0{}}\par
\pard{}As a convenience, you can define a variable and export it at the same time by doing:\par
\par
{\pard\keep\li720\f1{}export {\i variable} = value\par
\pard\f0{}}\par
\pard{}has the same result as:\par
\par
{{\i \pard\li720\f1{}variable} = value\line
export {\i variable}\par
\pard\f0{}}\par
\pard{}and\par
\par
{\pard\keep\li720\f1{}export {\i variable} := value\par
\pard\f0{}}\par
\pard{}has the same result as:\par
\par
{{\i \pard\li720\f1{}variable} := value\line
export {\i variable}\par
\pard\f0{}}\par
\pard{}Likewise,\par
\par
{\pard\keep\li720\f1{}export {\i variable} += value\par
\pard\f0{}}\par
\pard{}is just like:\par
\par
{{\i \pard\li720\f1{}variable} += value\line
export {\i variable}\par
\pard\f0{}}\par
\pard{}See {\uldb Appending More Text to Variables}{\v Appending}.\par
\par
\pard{}You may notice that the {\f1{}export} and {\f1{}unexport} directives work in {\f1{}make} in the same way they work in the shell, {\f1{}sh}.\par
\par
\pard{}If you want all variables to be exported by default, you can use {\f1{}export} by itself:\par
\par
{\pard\keep\li720\f1{}export\par
\pard\f0{}}\par
\pard{}This tells {\f1{}make} that variables which are not explicitly mentioned in an {\f1{}export} or {\f1{}unexport} directive should be exported.  Any variable given in an {\f1{}unexport} directive will still {\i not} be exported.  If you use {\f1{}export} by itself to export variables by default, variables whose names contain characters other than alphanumerics and underscores will not be exported unless specifically mentioned in an {\f1{}export} directive.\par
\par
\pard{}{K{\footnote K .EXPORT_ALL_VARIABLES}}The behavior elicited by an {\f1{}export} directive by itself was the default in older versions of GNU {\f1{}make}.  If your makefiles depend on this behavior and you want to be compatible with old versions of {\f1{}make}, you can write a rule for the special target {\f1{}.EXPORT_ALL_VARIABLES} instead of using the {\f1{}export} directive.  This will be ignored by old {\f1{}make}s, while the {\f1{}export} directive will cause a syntax error.  {K{\footnote K compatibility in exporting}} Likewise, you can use {\f1{}unexport} by itself to tell {\f1{}make} {\i not} to export variables by default.  Since this is the default behavior, you would only need to do this if {\f1{}export} had been used by itself earlier (in an included makefile, perhaps).  You {\b cannot} use {\f1{}export} and {\f1{}unexport} by themselves to have variables exported for some commands and not for others.  The last {\f1{}export} or {\f1{}unexport} directive that appears by itself determines the behavior for the entire run of {\f1{}make}.\par
\par
\pard{}{K{\footnote K MAKELEVEL}}{K{\footnote K recursion, level of}}As a special feature, the variable {\f1{}MAKELEVEL} is changed when it is passed down from level to level.  This variable's value is a string which is the depth of the level as a decimal number.  The value is {\f1{}0} for the top-level {\f1{}make}; {\f1{}1} for a sub-{\f1{}make}, {\f1{}2} for a sub-sub-{\f1{}make}, and so on.  The incrementation happens when {\f1{}make} sets up the environment for a command.\par
\par
\pard{}The main use of {\f1{}MAKELEVEL} is to test it in a conditional directive (see {\uldb Conditional Parts of Makefiles}{\v Conditionals}); this way you can write a makefile that behaves one way if run recursively and another way if run directly by you.\par
\par
\pard{}{K{\footnote K MAKEFILES}}You can use the variable {\f1{}MAKEFILES} to cause all sub-{\f1{}make} commands to use additional makefiles.  The value of {\f1{}MAKEFILES} is a whitespace-separated list of file names.  This variable, if defined in the outer-level makefile, is passed down through the environment; then it serves as a list of extra makefiles for the sub-{\f1{}make} to read before the usual or specified ones.  See {\uldb The\'5Cline Variable {\f1{}MAKEFILES}}{\v MAKEFILES_Variable}.\par
\par
\page\pard Node: {\b Options/Recursion}, \keepn Next: {\uldb -w Option}{\v _w_Option}, Prev: {\uldb Variables/Recursion}{\v Variables_Recursion}, Up: {\uldb Recursion}{\v Recursion}\line
K{\footnote K Options/Recursion}
#{\footnote Options_Recursion}
${\footnote \pard{}Communicating Options to a Sub-{\f1{}make}}\par
\pard{\fs24\b Communicating Options to a Sub-{\f1{}make}}\par
\par
\pard{}{K{\footnote K options, and recursion}}{K{\footnote K recursion, and options}} {K{\footnote K MAKEFLAGS}}Flags such as {\f1{}-s} and {\f1{}-k} are passed automatically to the sub-{\f1{}make} through the variable {\f1{}MAKEFLAGS}.  This variable is set up automatically by {\f1{}make} to contain the flag letters that {\f1{}make} received.  Thus, if you do {\f1{}make -ks} then {\f1{}MAKEFLAGS} gets the value {\f1{}ks}.\par
\par
\pard{}As a consequence, every sub-{\f1{}make} gets a value for {\f1{}MAKEFLAGS} in its environment.  In response, it takes the flags from that value and processes them as if they had been given as arguments.  See {\uldb Summary of Options}{\v Options_Summary}.\par
\par
\pard{}{K{\footnote K command line variable definitions, and recursion}}{K{\footnote K variables, command line, and recursion}}{K{\footnote K recursion, and command line variable definitions}}Likewise variables defined on the command line are passed to the sub-{\f1{}make} through {\f1{}MAKEFLAGS}.  Words in the value of {\f1{}MAKEFLAGS} that contain {\f1{}=}, {\f1{}make} treats as variable definitions just as if they appeared on the command line.  See {\uldb Overriding Variables}{\v Overriding}.\par
\par
\pard{}{K{\footnote K {\f1{}-C}, and recursion}}{K{\footnote K {\f1{}-f}, and recursion}}{K{\footnote K {\f1{}-o}, and recursion}}{K{\footnote K {\f1{}-W}, and recursion}}{K{\footnote K {\f1{}--directory}, and recursion}}{K{\footnote K {\f1{}--file}, and recursion}}{K{\footnote K {\f1{}--old-file}, and recursion}}{K{\footnote K {\f1{}--assume-old}, and recursion}}{K{\footnote K {\f1{}--assume-new}, and recursion}}{K{\footnote K {\f1{}--new-file}, and recursion}}{K{\footnote K recursion, and {\f1{}-C}}}{K{\footnote K recursion, and {\f1{}-f}}}{K{\footnote K recursion, and {\f1{}-o}}}{K{\footnote K recursion, and {\f1{}-W}}}The options {\f1{}-C}, {\f1{}-f}, {\f1{}-o}, and {\f1{}-W} are not put into {\f1{}MAKEFLAGS}; these options are not passed down.\par
\par
\pard{}{K{\footnote K {\f1{}-j}, and recursion}}{K{\footnote K {\f1{}--jobs}, and recursion}}{K{\footnote K recursion, and {\f1{}-j}}}{K{\footnote K job slots, and recursion}}The {\f1{}-j} option is a special case (see {\uldb Parallel Execution}{\v Parallel}).  If you set it to some numeric value {\f1{}N} and your operating system supports it (most any UNIX system will; others typically won't), the parent {\f1{}make} and all the sub-{\f1{}make}s will communicate to ensure that there are only {\f1{}N} jobs running at the same time between them all.  Note that any job that is marked recursive (see {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}) doesn't count against the total jobs (otherwise we could get {\f1{}N} sub-{\f1{}make}s running and have no slots left over for any real work!)\par
\par
\pard{}If your operating system doesn't support the above communication, then {\f1{}-j 1} is always put into {\f1{}MAKEFLAGS} instead of the value you specified.  This is because if the {\f1{}-j} option were passed down to sub-{\f1{}make}s, you would get many more jobs running in parallel than you asked for.  If you give {\f1{}-j} with no numeric argument, meaning to run as many jobs as possible in parallel, this is passed down, since multiple infinities are no more than one.\par
\par
\pard{}If you do not want to pass the other flags down, you must change the value of {\f1{}MAKEFLAGS}, like this:\par
\par
{\pard\keep\li720\f1{}subsystem:\line
        cd subdir && $(MAKE) MAKEFLAGS=\par
\pard\f0{}}\par
\pard{}{K{\footnote K MAKEOVERRIDES}}The command line variable definitions really appear in the variable {\f1{}MAKEOVERRIDES}, and {\f1{}MAKEFLAGS} contains a reference to this variable.  If you do want to pass flags down normally, but don't want to pass down the command line variable definitions, you can reset {\f1{}MAKEOVERRIDES} to empty, like this:\par
\par
{\pard\keep\li720\f1{}MAKEOVERRIDES =\par
\pard\f0{}}\par
\pard{}{K{\footnote K Arg list too long}}{K{\footnote K E2BIG}}This is not usually useful to do.  However, some systems have a small fixed limit on the size of the environment, and putting so much information into the value of {\f1{}MAKEFLAGS} can exceed it.  If you see the error message {\f1{}Arg list too long}, this may be the problem.  {K{\footnote K .POSIX}}{K{\footnote K POSIX.2}}(For strict compliance with POSIX.2, changing {\f1{}MAKEOVERRIDES} does not affect {\f1{}MAKEFLAGS} if the special target {\f1{}.POSIX} appears in the makefile.  You probably do not care about this.)\par
\par
\pard{}{K{\footnote K MFLAGS}}A similar variable {\f1{}MFLAGS} exists also, for historical compatibility.  It has the same value as {\f1{}MAKEFLAGS} except that it does not contain the command line variable definitions, and it always begins with a hyphen unless it is empty ({\f1{}MAKEFLAGS} begins with a hyphen only when it begins with an option that has no single-letter version, such as {\f1{}--warn-undefined-variables}).  {\f1{}MFLAGS} was traditionally used explicitly in the recursive {\f1{}make} command, like this:\par
\par
{\pard\keep\li720\f1{}subsystem:\line
        cd subdir && $(MAKE) $(MFLAGS)\par
\pard\f0{}}\par
\pard{}but now {\f1{}MAKEFLAGS} makes this usage redundant.  If you want your makefiles to be compatible with old {\f1{}make} programs, use this technique; it will work fine with more modern {\f1{}make} versions too.\par
\par
\pard{}{K{\footnote K setting options from environment}}{K{\footnote K options, setting from environment}}{K{\footnote K setting options in makefiles}}{K{\footnote K options, setting in makefiles}}The {\f1{}MAKEFLAGS} variable can also be useful if you want to have certain options, such as {\f1{}-k} (see {\uldb Summary of Options}{\v Options_Summary}), set each time you run {\f1{}make}.  You simply put a value for {\f1{}MAKEFLAGS} in your environment.  You can also set {\f1{}MAKEFLAGS} in a makefile, to specify additional flags that should also be in effect for that makefile.  (Note that you cannot use {\f1{}MFLAGS} this way.  That variable is set only for compatibility; {\f1{}make} does not interpret a value you set for it in any way.)\par
\par
\pard{}When {\f1{}make} interprets the value of {\f1{}MAKEFLAGS} (either from the environment or from a makefile), it first prepends a hyphen if the value does not already begin with one.  Then it chops the value into words separated by blanks, and parses these words as if they were options given on the command line (except that {\f1{}-C}, {\f1{}-f}, {\f1{}-h}, {\f1{}-o}, {\f1{}-W}, and their long-named versions are ignored; and there is no error for an invalid option).\par
\par
\pard{}If you do put {\f1{}MAKEFLAGS} in your environment, you should be sure not to include any options that will drastically affect the actions of {\f1{}make} and undermine the purpose of makefiles and of {\f1{}make} itself.  For instance, the {\f1{}-t}, {\f1{}-n}, and {\f1{}-q} options, if put in one of these variables, could have disastrous consequences and would certainly have at least surprising and probably annoying effects.\par
\par
\page\pard Node: {\b -w Option}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Options/Recursion}{\v Options_Recursion}, Up: {\uldb Recursion}{\v Recursion}\line
K{\footnote K -w Option}
#{\footnote _w_Option}
${\footnote \pard{}The {\f1{}--print-directory} Option}\par
\pard{\fs24\b The {\f1{}--print-directory} Option}\par
\par
\pard{}{K{\footnote K directories, printing them}}{K{\footnote K printing directories}}{K{\footnote K recursion, and printing directories}} If you use several levels of recursive {\f1{}make} invocations, the {\f1{}-w} or {\f1{}--print-directory} option can make the output a lot easier to understand by showing each directory as {\f1{}make} starts processing it and as {\f1{}make} finishes processing it.  For example, if {\f1{}make -w} is run in the directory {\f1{}/u/gnu/make}, {\f1{}make} will print a line of the form:\par
\par
{\pard\keep\li720\f1{}make: Entering directory `/u/gnu/make'.\par
\pard\f0{}}\par
\pard{}before doing anything else, and a line of the form:\par
\par
{\pard\keep\li720\f1{}make: Leaving directory `/u/gnu/make'.\par
\pard\f0{}}\par
\pard{}when processing is completed.\par
\par
\pard{}{K{\footnote K {\f1{}-C}, and {\f1{}-w}}}{K{\footnote K {\f1{}--directory}, and {\f1{}--print-directory}}}{K{\footnote K recursion, and {\f1{}-w}}}{K{\footnote K {\f1{}-w}, and {\f1{}-C}}}{K{\footnote K {\f1{}-w}, and recursion}}{K{\footnote K {\f1{}--print-directory}, and {\f1{}--directory}}}{K{\footnote K {\f1{}--print-directory}, and recursion}}{K{\footnote K {\f1{}--no-print-directory}}}{K{\footnote K {\f1{}--print-directory}, disabling}}{K{\footnote K {\f1{}-w}, disabling}}Normally, you do not need to specify this option because {\f1{}make} does it for you: {\f1{}-w} is turned on automatically when you use the {\f1{}-C} option, and in sub-{\f1{}make}s.  {\f1{}make} will not automatically turn on {\f1{}-w} if you also use {\f1{}-s}, which says to be silent, or if you use {\f1{}--no-print-directory} to explicitly disable it.\par
\par
\page\pard Node: {\b Sequences}, \keepn Next: {\uldb Empty Commands}{\v Empty_Commands}, Prev: {\uldb Recursion}{\v Recursion}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Sequences}
#{\footnote Sequences}
${\footnote \pard{}Defining Canned Command Sequences}\par
\pard{\fs24\b Defining Canned Command Sequences}\par
\par
\pard{}{K{\footnote K sequences of commands}}{K{\footnote K commands, sequences of}} When the same sequence of commands is useful in making various targets, you can define it as a canned sequence with the {\f1{}define} directive, and refer to the canned sequence from the rules for those targets.  The canned sequence is actually a variable, so the name must not conflict with other variable names.\par
\par
\pard{}Here is an example of defining a canned sequence of commands:\par
\par
{\pard\keep\li720\f1{}define run-yacc\line
yacc $(firstword $^)\line
mv y.tab.c $@\line
endef\par
\pard\f0{}}{K{\footnote K {\f1{}yacc}}}\par
\par
\pard{}Here {\f1{}run-yacc} is the name of the variable being defined; {\f1{}endef} marks the end of the definition; the lines in between are the commands.  The {\f1{}define} directive does not expand variable references and function calls in the canned sequence; the {\f1{}$} characters, parentheses, variable names, and so on, all become part of the value of the variable you are defining.  See {\uldb Defining Variables Verbatim}{\v Defining}, for a complete explanation of {\f1{}define}.\par
\par
\pard{}The first command in this example runs Yacc on the first prerequisite of whichever rule uses the canned sequence.  The output file from Yacc is always named {\f1{}y.tab.c}.  The second command moves the output to the rule's target file name.\par
\par
\pard{}To use the canned sequence, substitute the variable into the commands of a rule.  You can substitute it like any other variable (see {\uldb Basics of Variable References}{\v Reference}).  Because variables defined by {\f1{}define} are recursively expanded variables, all the variable references you wrote inside the {\f1{}define} are expanded now.  For example:\par
\par
{\pard\keep\li720\f1{}foo.c : foo.y\line
        $(run-yacc)\par
\pard\f0{}}\par
{\f1{}\pard{}foo.y} will be substituted for the variable {\f1{}$^} when it occurs in {\f1{}run-yacc}'s value, and {\f1{}foo.c} for {\f1{}$@}.\par
\par
\pard{}This is a realistic example, but this particular one is not needed in practice because {\f1{}make} has an implicit rule to figure out these commands based on the file names involved (see {\uldb Using Implicit Rules}{\v Implicit_Rules}).\par
\par
\pard{}{K{\footnote K @, and {\f1{}define}}}{K{\footnote K -, and {\f1{}define}}}{K{\footnote K +, and {\f1{}define}}}In command execution, each line of a canned sequence is treated just as if the line appeared on its own in the rule, preceded by a tab.  In particular, {\f1{}make} invokes a separate subshell for each line.  You can use the special prefix characters that affect command lines ({\f1{}@}, {\f1{}-}, and {\f1{}+}) on each line of a canned sequence.  See {\uldb Writing the Commands in Rules}{\v Commands}.  For example, using this canned sequence:\par
\par
{\pard\keep\li720\f1{}define frobnicate\line
@echo "frobnicating target $@"\line
frob-step-1 $< -o $@-step-1\line
frob-step-2 $@-step-1 -o $@\line
endef\par
\pard\f0{}}\par
{\f1{}\pard{}make} will not echo the first line, the {\f1{}echo} command.  But it {\i will} echo the following two command lines.\par
\par
\pard{}On the other hand, prefix characters on the command line that refers to a canned sequence apply to every line in the sequence.  So the rule:\par
\par
{\pard\keep\li720\f1{}frob.out: frob.in\line
        @$(frobnicate)\par
\pard\f0{}}\par
\pard{}does not echo {\i any} commands.  (See {\uldb Command Echoing}{\v Echoing}, for a full explanation of {\f1{}@}.)\par
\par
\page\pard Node: {\b Empty Commands}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Sequences}{\v Sequences}, Up: {\uldb Commands}{\v Commands}\line
K{\footnote K Empty Commands}
#{\footnote Empty_Commands}
${\footnote \pard{}Using Empty Commands}\par
\pard{\fs24\b Using Empty Commands}\par
\par
\pard{}{K{\footnote K empty commands}}{K{\footnote K commands, empty}} It is sometimes useful to define commands which do nothing.  This is done simply by giving a command that consists of nothing but whitespace.  For example:\par
\par
{\pard\keep\li720\f1{}target: ;\par
\pard\f0{}}\par
\pard{}defines an empty command string for {\f1{}target}.  You could also use a line beginning with a tab character to define an empty command string, but this would be confusing because such a line looks empty.\par
\par
\pard{}{K{\footnote K .DEFAULT, and empty commands}}You may be wondering why you would want to define a command string that does nothing.  The only reason this is useful is to prevent a target from getting implicit commands (from implicit rules or the {\f1{}.DEFAULT} special target; see {\uldb Implicit Rules}{\v Implicit_Rules} and see {\uldb Defining Last-Resort Default Rules}{\v Last_Resort}).\par
\par
\pard{}You may be inclined to define empty command strings for targets that are not actual files, but only exist so that their prerequisites can be remade.  However, this is not the best way to do that, because the prerequisites may not be remade properly if the target file actually does exist.  See {\uldb Phony Targets}{\v Phony_Targets}, for a better way to do this.\par
\par
\page\pard Node: {\b Using Variables}, \keepn Next: {\uldb Conditionals}{\v Conditionals}, Prev: {\uldb Commands}{\v Commands}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Using Variables}
#{\footnote Using_Variables}
${\footnote \pard{}How to Use Variables}\par
\pard{\fs24\b How to Use Variables}\par
\par
\pard{}{K{\footnote K variable}}{K{\footnote K value}}{K{\footnote K recursive variable expansion}}{K{\footnote K simple variable expansion}} A \'A2variable\'A2 is a name defined in a makefile to represent a string of text, called the variable's \'A2value\'A2.  These values are substituted by explicit request into targets, prerequisites, commands, and other parts of the makefile.  (In some other versions of {\f1{}make}, variables are called \'A2macros\'A2.)  {K{\footnote K macro}} Variables and functions in all parts of a makefile are expanded when read, except for the shell commands in rules, the right-hand sides of variable definitions using {\f1{}=}, and the bodies of variable definitions using the {\f1{}define} directive.\par
\par
\pard{}Variables can represent lists of file names, options to pass to compilers, programs to run, directories to look in for source files, directories to write output in, or anything else you can imagine.\par
\par
\pard{}A variable name may be any sequence of characters not containing {\f1{}:}, {\f1{}#}, {\f1{}=}, or leading or trailing whitespace.  However, variable names containing characters other than letters, numbers, and underscores should be avoided, as they may be given special meanings in the future, and with some shells they cannot be passed through the environment to a sub-{\f1{}make} (see {\uldb Communicating Variables to a Sub-{\f1{}make}}{\v Variables_Recursion}).\par
\par
\pard{}Variable names are case-sensitive.  The names {\f1{}foo}, {\f1{}FOO}, and {\f1{}Foo} all refer to different variables.\par
\par
\pard{}It is traditional to use upper case letters in variable names, but we recommend using lower case letters for variable names that serve internal purposes in the makefile, and reserving upper case for parameters that control implicit rules or for parameters that the user should override with command options (see {\uldb Overriding Variables}{\v Overriding}).\par
\par
\pard{}A few variables have names that are a single punctuation character or just a few characters.  These are the \'A2automatic variables\'A2, and they have particular specialized uses.  See {\uldb Automatic Variables}{\v Automatic}.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Reference}{\v Reference}\tab How to use the value of a variable.\par
{\uldb Flavors}{\v Flavors}\tab Variables come in two flavors.\par
{\uldb Advanced}{\v Advanced}\tab Advanced features for referencing a variable.\par
{\uldb Values}{\v Values}\tab All the ways variables get their values.\par
{\uldb Setting}{\v Setting}\tab How to set a variable in the makefile.\par
{\uldb Appending}{\v Appending}\tab How to append more text to the old value of a variable.\par
{\uldb Override Directive}{\v Override_Directive}\tab How to set a variable in the makefile even if the user has set it with a command argument.\par
{\uldb Defining}{\v Defining}\tab An alternate way to set a variable to a verbatim string.\par
{\uldb Environment}{\v Environment}\tab Variable values can come from the environment.\par
{\uldb Target-specific}{\v Target_specific}\tab Variable values can be defined on a per-target basis.\par
{\uldb Pattern-specific}{\v Pattern_specific}\tab Target-specific variable values can be applied to a group of targets that match a pattern.\par
{\uldb Automatic}{\v Automatic}\tab Some special variables have predefined meanings for use with implicit rules.\par
\pard{}}\par
\page\pard Node: {\b Reference}, \keepn Next: {\uldb Flavors}{\v Flavors}, Prev: {\uldb }{\v }, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Reference}
#{\footnote Reference}
${\footnote \pard{}Basics of Variable References}\par
\pard{\fs24\b Basics of Variable References}\par
\par
\pard{}{K{\footnote K variables, how to reference}}{K{\footnote K reference to variables}}{K{\footnote K {\f1{}$}, in variable reference}}{K{\footnote K dollar sign ({\f1{}$}), in variable reference}} To substitute a variable's value, write a dollar sign followed by the name of the variable in parentheses or braces: either {\f1{}$(foo)} or {\f1{}$\'7Bfoo\'7D} is a valid reference to the variable {\f1{}foo}.  This special significance of {\f1{}$} is why you must write {\f1{}$$} to have the effect of a single dollar sign in a file name or command.\par
\par
\pard{}Variable references can be used in any context: targets, prerequisites, commands, most directives, and new variable values.  Here is an example of a common case, where a variable holds the names of all the object files in a program:\par
\par
{{\pard\keep\li720\f1{}objects = program.o foo.o utils.o\line
program : $(objects)\line
        cc -o program $(objects)\line
\line
$(objects) : defs.h\par
\pard\keep\li720{}}}\par
\pard\f0{}Variable references work by strict textual substitution.  Thus, the rule\par
\par
{{\pard\keep\li720\f1{}foo = c\line
prog.o : prog.$(foo)\line
        $(foo)$(foo) -$(foo) prog.$(foo)\par
\pard\keep\li720{}}}\par
\pard\f0{}could be used to compile a C program {\f1{}prog.c}.  Since spaces before the variable value are ignored in variable assignments, the value of {\f1{}foo} is precisely {\f1{}c}.  (Don't actually write your makefiles this way!)\par
\par
\pard{}A dollar sign followed by a character other than a dollar sign, open-parenthesis or open-brace treats that single character as the variable name.  Thus, you could reference the variable {\f1{}x} with {\f1{}$x}.  However, this practice is strongly discouraged, except in the case of the automatic variables (see {\uldb Automatic Variables}{\v Automatic}).\par
\par
\page\pard Node: {\b Flavors}, \keepn Next: {\uldb Advanced}{\v Advanced}, Prev: {\uldb Reference}{\v Reference}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Flavors}
#{\footnote Flavors}
${\footnote \pard{}The Two Flavors of Variables}\par
\pard{\fs24\b The Two Flavors of Variables}\par
\par
\pard{}{K{\footnote K flavors of variables}}{K{\footnote K recursive variable expansion}}{K{\footnote K variables, flavors}}{K{\footnote K recursively expanded variables}}{K{\footnote K variables, recursively expanded}} There are two ways that a variable in GNU {\f1{}make} can have a value; we call them the two \'A2flavors\'A2 of variables.  The two flavors are distinguished in how they are defined and in what they do when expanded.\par
\par
\pard{}{K{\footnote K =}}The first flavor of variable is a \'A2recursively expanded\'A2 variable.  Variables of this sort are defined by lines using {\f1{}=} (see {\uldb Setting Variables}{\v Setting}) or by the {\f1{}define} directive (see {\uldb Defining Variables Verbatim}{\v Defining}).  The value you specify is installed verbatim; if it contains references to other variables, these references are expanded whenever this variable is substituted (in the course of expanding some other string).  When this happens, it is called \'A2recursive expansion\'A2.\par
\par
\pard{}For example,\par
\par
{\pard\keep\li720\f1{}foo = $(bar)\line
bar = $(ugh)\line
ugh = Huh?\line
\line
all:;echo $(foo)\par
\pard\f0{}}\par
\pard{}will echo {\f1{}Huh?}: {\f1{}$(foo)} expands to {\f1{}$(bar)} which expands to {\f1{}$(ugh)} which finally expands to {\f1{}Huh?}.\par
\par
\pard{}This flavor of variable is the only sort supported by other versions of {\f1{}make}.  It has its advantages and its disadvantages.  An advantage (most would say) is that:\par
\par
{\pard\keep\li720\f1{}CFLAGS = $(include_dirs) -O\line
include_dirs = -Ifoo -Ibar\par
\pard\f0{}}\par
\pard{}will do what was intended: when {\f1{}CFLAGS} is expanded in a command, it will expand to {\f1{}-Ifoo -Ibar -O}.  A major disadvantage is that you cannot append something on the end of a variable, as in\par
\par
{\pard\keep\li720\f1{}CFLAGS = $(CFLAGS) -O\par
\pard\f0{}}\par
\pard{}because it will cause an infinite loop in the variable expansion.  (Actually {\f1{}make} detects the infinite loop and reports an error.)  {K{\footnote K loops in variable expansion}}{K{\footnote K variables, loops in expansion}} Another disadvantage is that any functions (see {\uldb Functions for Transforming Text}{\v Functions}) referenced in the definition will be executed every time the variable is expanded.  This makes {\f1{}make} run slower; worse, it causes the {\f1{}wildcard} and {\f1{}shell} functions to give unpredictable results because you cannot easily control when they are called, or even how many times.\par
\par
\pard{}To avoid all the problems and inconveniences of recursively expanded variables, there is another flavor: simply expanded variables.\par
\par
\pard{}{K{\footnote K simply expanded variables}}{K{\footnote K variables, simply expanded}}{K{\footnote K :=}}\'A2Simply expanded variables\'A2 are defined by lines using {\f1{}:=} (see {\uldb Setting Variables}{\v Setting}).  The value of a simply expanded variable is scanned once and for all, expanding any references to other variables and functions, when the variable is defined.  The actual value of the simply expanded variable is the result of expanding the text that you write.  It does not contain any references to other variables; it contains their values {\i as of the time this variable was defined}.  Therefore,\par
\par
{\pard\keep\li720\f1{}x := foo\line
y := $(x) bar\line
x := later\par
\pard\f0{}}\par
\pard{}is equivalent to\par
\par
{\pard\keep\li720\f1{}y := foo bar\line
x := later\par
\pard\f0{}}\par
\pard{}When a simply expanded variable is referenced, its value is substituted verbatim.\par
\par
\pard{}Here is a somewhat more complicated example, illustrating the use of {\f1{}:=} in conjunction with the {\f1{}shell} function.  (See {\uldb The {\f1{}shell} Function}{\v Shell_Function}.)  This example also shows use of the variable {\f1{}MAKELEVEL}, which is changed when it is passed down from level to level.  (See {\uldb Communicating Variables to a\'5Cline Sub-{\f1{}make}}{\v Variables_Recursion}, for information about {\f1{}MAKELEVEL}.)\par
\par
\pard{}{K{\footnote K MAKELEVEL}}{K{\footnote K MAKE}}{\par
{\pard\keep\li720\f1{}ifeq (0,$\'7BMAKELEVEL\'7D)\line
cur-dir   := $(shell pwd)\line
whoami    := $(shell whoami)\line
host-type := $(shell arch)\line
MAKE := $\'7BMAKE\'7D host-type=$\'7Bhost-type\'7D whoami=$\'7Bwhoami\'7D\line
endif\par
\pard\keep\li720{}}}\par
\pard\f0{}An advantage of this use of {\f1{}:=} is that a typical `descend into a directory' command then looks like this:\par
\par
{{\pard\keep\li720\f1{}$\'7Bsubdirs\'7D:\line
      $\'7BMAKE\'7D cur-dir=$\'7Bcur-dir\'7D/$@ -C $@ all\par
\pard\keep\li720{}}}\par
\pard\f0{}Simply expanded variables generally make complicated makefile programming more predictable because they work like variables in most programming languages.  They allow you to redefine a variable using its own value (or its value processed in some way by one of the expansion functions) and to use the expansion functions much more efficiently (see {\uldb Functions for Transforming Text}{\v Functions}).\par
\par
\pard{}{K{\footnote K spaces, in variable values}}{K{\footnote K whitespace, in variable values}}{K{\footnote K variables, spaces in values}}You can also use them to introduce controlled leading whitespace into variable values.  Leading whitespace characters are discarded from your input before substitution of variable references and function calls; this means you can include leading spaces in a variable value by protecting them with variable references, like this:\par
\par
{\pard\keep\li720\f1{}nullstring :=\line
space := $(nullstring) # end of the line\par
\pard\f0{}}\par
\pard{}Here the value of the variable {\f1{}space} is precisely one space.  The comment {\f1{}# end of the line} is included here just for clarity.  Since trailing space characters are {\i not} stripped from variable values, just a space at the end of the line would have the same effect (but be rather hard to read).  If you put whitespace at the end of a variable value, it is a good idea to put a comment like that at the end of the line to make your intent clear.  Conversely, if you do {\i not} want any whitespace characters at the end of your variable value, you must remember not to put a random comment on the end of the line after some whitespace, such as this:\par
\par
{\pard\keep\li720\f1{}dir := /foo/bar    # directory to put the frobs in\par
\pard\f0{}}\par
\pard{}Here the value of the variable {\f1{}dir} is {\f1{}/foo/bar    } (with four trailing spaces), which was probably not the intention.  (Imagine something like {\f1{}$(dir)/file} with this definition!)\par
\par
\pard{}{K{\footnote K conditional variable assignment}}{K{\footnote K variables, conditional assignment}}{K{\footnote K ?=}}There is another assignment operator for variables, {\f1{}?=}.  This is called a conditional variable assignment operator, because it only has an effect if the variable is not yet defined.  This statement:\par
\par
{\pard\keep\li720\f1{}FOO ?= bar\par
\pard\f0{}}\par
\pard{}is exactly equivalent to this (see {\uldb The {\f1{}origin} Function}{\v Origin_Function}):\par
\par
{\pard\keep\li720\f1{}ifeq ($(origin FOO), undefined)\line
  FOO = bar\line
endif\par
\pard\f0{}}\par
\pard{}Note that a variable set to an empty value is still defined, so {\f1{}?=} will not set that variable.\par
\par
\page\pard Node: {\b Advanced}, \keepn Next: {\uldb Values}{\v Values}, Prev: {\uldb Flavors}{\v Flavors}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Advanced}
#{\footnote Advanced}
${\footnote \pard{}Advanced Features for Reference to Variables}\par
\pard{\fs24\b Advanced Features for Reference to Variables}\par
\par
\pard{}{K{\footnote K reference to variables}} This section describes some advanced features you can use to reference variables in more flexible ways.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Substitution Refs}{\v Substitution_Refs}\tab Referencing a variable with substitutions on the value.\par
{\uldb Computed Names}{\v Computed_Names}\tab Computing the name of the variable to refer to.\par
\pard{}}\par
\page\pard Node: {\b Substitution Refs}, \keepn Next: {\uldb Computed Names}{\v Computed_Names}, Prev: {\uldb }{\v }, Up: {\uldb Advanced}{\v Advanced}\line
K{\footnote K Substitution Refs}
#{\footnote Substitution_Refs}
${\footnote \pard{}Substitution References}\par
\pard{\fs24\b Substitution References}\par
\par
\pard{}{K{\footnote K modified variable reference}}{K{\footnote K substitution variable reference}}{K{\footnote K variables, modified reference}}{K{\footnote K variables, substitution reference}} {K{\footnote K variables, substituting suffix in}}{K{\footnote K suffix, substituting in variables}}A \'A2substitution reference\'A2 substitutes the value of a variable with alterations that you specify.  It has the form {\f1{}$({\i var}:{\i a}={\i b})} (or {\f1{}$\'7B{\i var}:{\i a}={\i b}\'7D}) and its meaning is to take the value of the variable {\i var}, replace every {\i a} at the end of a word with {\i b} in that value, and substitute the resulting string.\par
\par
\pard{}When we say "at the end of a word", we mean that {\i a} must appear either followed by whitespace or at the end of the value in order to be replaced; other occurrences of {\i a} in the value are unaltered.  For example:\par
\par
{\pard\keep\li720\f1{}foo := a.o b.o c.o\line
bar := $(foo:.o=.c)\par
\pard\f0{}}\par
\pard{}sets {\f1{}bar} to {\f1{}a.c b.c c.c}.  See {\uldb Setting Variables}{\v Setting}.\par
\par
\pard{}A substitution reference is actually an abbreviation for use of the {\f1{}patsubst} expansion function (see {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}).  We provide substitution references as well as {\f1{}patsubst} for compatibility with other implementations of {\f1{}make}.\par
\par
\pard{}{K{\footnote K patsubst}}Another type of substitution reference lets you use the full power of the {\f1{}patsubst} function.  It has the same form {\f1{}$({\i var}:{\i a}={\i b})} described above, except that now {\i a} must contain a single {\f1{}%} character.  This case is equivalent to {\f1{}$(patsubst {\i a},{\i b},$({\i var}))}.  See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}, for a description of the {\f1{}patsubst} function.\par
\par
{{\pard\keep\li720\f1{}For example:\par
\line
\pard\keep\li720{}foo := a.o b.o c.o\line
bar := $(foo:%.o=%.c)\par
\pard\keep\li720{}}}\par
\pard\f0{}sets {\f1{}bar} to {\f1{}a.c b.c c.c}.\par
\par
\page\pard Node: {\b Computed Names}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Substitution Refs}{\v Substitution_Refs}, Up: {\uldb Advanced}{\v Advanced}\line
K{\footnote K Computed Names}
#{\footnote Computed_Names}
${\footnote \pard{}Computed Variable Names}\par
\pard{\fs24\b Computed Variable Names}\par
\par
\pard{}{K{\footnote K nested variable reference}}{K{\footnote K computed variable name}}{K{\footnote K variables, computed names}}{K{\footnote K variables, nested references}}{K{\footnote K variables, {\f1{}$} in name}}{K{\footnote K {\f1{}$}, in variable name}}{K{\footnote K dollar sign ({\f1{}$}), in variable name}} Computed variable names are a complicated concept needed only for sophisticated makefile programming.  For most purposes you need not consider them, except to know that making a variable with a dollar sign in its name might have strange results.  However, if you are the type that wants to understand everything, or you are actually interested in what they do, read on.\par
\par
\pard{}Variables may be referenced inside the name of a variable.  This is called a \'A2computed variable name\'A2 or a \'A2nested variable reference\'A2.  For example,\par
\par
{\pard\keep\li720\f1{}x = y\line
y = z\line
a := $($(x))\par
\pard\f0{}}\par
\pard{}defines {\f1{}a} as {\f1{}z}: the {\f1{}$(x)} inside {\f1{}$($(x))} expands to {\f1{}y}, so {\f1{}$($(x))} expands to {\f1{}$(y)} which in turn expands to {\f1{}z}.  Here the name of the variable to reference is not stated explicitly; it is computed by expansion of {\f1{}$(x)}.  The reference {\f1{}$(x)} here is nested within the outer variable reference.\par
\par
\pard{}The previous example shows two levels of nesting, but any number of levels is possible.  For example, here are three levels:\par
\par
{\pard\keep\li720\f1{}x = y\line
y = z\line
z = u\line
a := $($($(x)))\par
\pard\f0{}}\par
\pard{}Here the innermost {\f1{}$(x)} expands to {\f1{}y}, so {\f1{}$($(x))} expands to {\f1{}$(y)} which in turn expands to {\f1{}z}; now we have {\f1{}$(z)}, which becomes {\f1{}u}.\par
\par
\pard{}References to recursively-expanded variables within a variable name are reexpanded in the usual fashion.  For example:\par
\par
{\pard\keep\li720\f1{}x = $(y)\line
y = z\line
z = Hello\line
a := $($(x))\par
\pard\f0{}}\par
\pard{}defines {\f1{}a} as {\f1{}Hello}: {\f1{}$($(x))} becomes {\f1{}$($(y))} which becomes {\f1{}$(z)} which becomes {\f1{}Hello}.\par
\par
\pard{}Nested variable references can also contain modified references and function invocations (see {\uldb Functions for Transforming Text}{\v Functions}), just like any other reference.  For example, using the {\f1{}subst} function (see {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}):\par
\par
{{\pard\keep\li720\f1{}x = variable1\line
variable2 := Hello\line
y = $(subst 1,2,$(x))\line
z = y\line
a := $($($(z)))\par
\pard\keep\li720{}}}\par
\pard\f0{}eventually defines {\f1{}a} as {\f1{}Hello}.  It is doubtful that anyone would ever want to write a nested reference as convoluted as this one, but it works: {\f1{}$($($(z)))} expands to {\f1{}$($(y))} which becomes {\f1{}$($(subst 1,2,$(x)))}.  This gets the value {\f1{}variable1} from {\f1{}x} and changes it by substitution to {\f1{}variable2}, so that the entire string becomes {\f1{}$(variable2)}, a simple variable reference whose value is {\f1{}Hello}.\par
\par
\pard{}A computed variable name need not consist entirely of a single variable reference.  It can contain several variable references, as well as some invariant text.  For example,\par
\par
{{\pard\keep\li720\f1{}a_dirs := dira dirb\line
1_dirs := dir1 dir2\par
\pard\keep\li720{}}\line
{a_files := filea fileb\line
1_files := file1 file2\par
\pard\keep\li720{}}\line
{ifeq "$(use_a)" "yes"\line
a1 := a\line
else\line
a1 := 1\line
endif\par
\pard\keep\li720{}}\line
{ifeq "$(use_dirs)" "yes"\line
df := dirs\line
else\line
df := files\line
endif\line
\line
dirs := $($(a1)_$(df))\par
\pard\keep\li720{}}}\par
\pard\f0{}will give {\f1{}dirs} the same value as {\f1{}a_dirs}, {\f1{}1_dirs}, {\f1{}a_files} or {\f1{}1_files} depending on the settings of {\f1{}use_a} and {\f1{}use_dirs}.\par
\par
\pard{}Computed variable names can also be used in substitution references:\par
\par
{{\pard\keep\li720\f1{}a_objects := a.o b.o c.o\line
1_objects := 1.o 2.o 3.o\line
\line
sources := $($(a1)_objects:.o=.c)\par
\pard\keep\li720{}}}\par
\pard\f0{}defines {\f1{}sources} as either {\f1{}a.c b.c c.c} or {\f1{}1.c 2.c 3.c}, depending on the value of {\f1{}a1}.\par
\par
\pard{}The only restriction on this sort of use of nested variable references is that they cannot specify part of the name of a function to be called.  This is because the test for a recognized function name is done before the expansion of nested references.  For example,\par
\par
{{\pard\keep\li720\f1{}ifdef do_sort\line
func := sort\line
else\line
func := strip\line
endif\par
\pard\keep\li720{}}\line
{bar := a d b g q c\par
\pard\keep\li720{}}\line
{foo := $($(func) $(bar))\par
\pard\keep\li720{}}}\par
\pard\f0{}attempts to give {\f1{}foo} the value of the variable {\f1{}sort a d b g q c} or {\f1{}strip a d b g q c}, rather than giving {\f1{}a d b g q c} as the argument to either the {\f1{}sort} or the {\f1{}strip} function.  This restriction could be removed in the future if that change is shown to be a good idea.\par
\par
\pard{}You can also use computed variable names in the left-hand side of a variable assignment, or in a {\f1{}define} directive, as in:\par
\par
{\pard\keep\li720\f1{}dir = foo\line
$(dir)_sources := $(wildcard $(dir)/*.c)\line
define $(dir)_print\line
lpr $($(dir)_sources)\line
endef\par
\pard\f0{}}\par
\pard{}This example defines the variables {\f1{}dir}, {\f1{}foo_sources}, and {\f1{}foo_print}.\par
\par
\pard{}Note that \'A2nested variable references\'A2 are quite different from \'A2recursively expanded variables\'A2 (see {\uldb The Two Flavors of Variables}{\v Flavors}), though both are used together in complex ways when doing makefile programming.\par
\par
\page\pard Node: {\b Values}, \keepn Next: {\uldb Setting}{\v Setting}, Prev: {\uldb Advanced}{\v Advanced}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Values}
#{\footnote Values}
${\footnote \pard{}How Variables Get Their Values}\par
\pard{\fs24\b How Variables Get Their Values}\par
\par
\pard{}{K{\footnote K variables, how they get their values}}{K{\footnote K value, how a variable gets it}} Variables can get values in several different ways:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}You can specify an overriding value when you run {\f1{}make}.  See {\uldb Overriding Variables}{\v Overriding}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}You can specify a value in the makefile, either with an assignment (see {\uldb Setting Variables}{\v Setting}) or with a verbatim definition (see {\uldb Defining Variables Verbatim}{\v Defining}).\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Variables in the environment become {\f1{}make} variables.  See {\uldb Variables from the Environment}{\v Environment}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Several \'A2automatic\'A2 variables are given new values for each rule.  Each of these has a single conventional use.  See {\uldb Automatic Variables}{\v Automatic}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Several variables have constant initial values.  See {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}.\par
\pard{}}\par
\page\pard Node: {\b Setting}, \keepn Next: {\uldb Appending}{\v Appending}, Prev: {\uldb Values}{\v Values}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Setting}
#{\footnote Setting}
${\footnote \pard{}Setting Variables}\par
\pard{\fs24\b Setting Variables}\par
\par
\pard{}{K{\footnote K setting variables}}{K{\footnote K variables, setting}}{K{\footnote K =}}{K{\footnote K :=}}{K{\footnote K ?=}} To set a variable from the makefile, write a line starting with the variable name followed by {\f1{}=} or {\f1{}:=}.  Whatever follows the {\f1{}=} or {\f1{}:=} on the line becomes the value.  For example,\par
\par
{\pard\keep\li720\f1{}objects = main.o foo.o bar.o utils.o\par
\pard\f0{}}\par
\pard{}defines a variable named {\f1{}objects}.  Whitespace around the variable name and immediately after the {\f1{}=} is ignored.\par
\par
\pard{}Variables defined with {\f1{}=} are \'A2recursively expanded\'A2 variables.  Variables defined with {\f1{}:=} are \'A2simply expanded\'A2 variables; these definitions can contain variable references which will be expanded before the definition is made.  See {\uldb The Two Flavors of Variables}{\v Flavors}.\par
\par
\pard{}The variable name may contain function and variable references, which are expanded when the line is read to find the actual variable name to use.\par
\par
\pard{}There is no limit on the length of the value of a variable except the amount of swapping space on the computer.  When a variable definition is long, it is a good idea to break it into several lines by inserting backslash-newline at convenient places in the definition.  This will not affect the functioning of {\f1{}make}, but it will make the makefile easier to read.\par
\par
\pard{}Most variable names are considered to have the empty string as a value if you have never set them.  Several variables have built-in initial values that are not empty, but you can set them in the usual ways (see {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}).  Several special variables are set automatically to a new value for each rule; these are called the \'A2automatic\'A2 variables (see {\uldb Automatic Variables}{\v Automatic}).\par
\par
\pard{}If you'd like a variable to be set to a value only if it's not already set, then you can use the shorthand operator {\f1{}?=} instead of {\f1{}=}.  These two settings of the variable {\f1{}FOO} are identical (see {\uldb The {\f1{}origin} Function}{\v Origin_Function}):\par
\par
{\pard\keep\li720\f1{}FOO ?= bar\par
\pard\f0{}}\par
\pard{}and\par
\par
{\pard\keep\li720\f1{}ifeq ($(origin FOO), undefined)\line
FOO = bar\line
endif\par
\pard\f0{}}\par
\page\pard Node: {\b Appending}, \keepn Next: {\uldb Override Directive}{\v Override_Directive}, Prev: {\uldb Setting}{\v Setting}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Appending}
#{\footnote Appending}
${\footnote \pard{}Appending More Text to Variables}\par
\pard{\fs24\b Appending More Text to Variables}\par
\par
\pard{}{K{\footnote K +=}}{K{\footnote K appending to variables}}{K{\footnote K variables, appending to}} Often it is useful to add more text to the value of a variable already defined.  You do this with a line containing {\f1{}+=}, like this:\par
\par
{\pard\keep\li720\f1{}objects += another.o\par
\pard\f0{}}\par
\pard{}This takes the value of the variable {\f1{}objects}, and adds the text {\f1{}another.o} to it (preceded by a single space).  Thus:\par
\par
{\pard\keep\li720\f1{}objects = main.o foo.o bar.o utils.o\line
objects += another.o\par
\pard\f0{}}\par
\pard{}sets {\f1{}objects} to {\f1{}main.o foo.o bar.o utils.o another.o}.\par
\par
\pard{}Using {\f1{}+=} is similar to:\par
\par
{\pard\keep\li720\f1{}objects = main.o foo.o bar.o utils.o\line
objects := $(objects) another.o\par
\pard\f0{}}\par
\pard{}but differs in ways that become important when you use more complex values.\par
\par
\pard{}When the variable in question has not been defined before, {\f1{}+=} acts just like normal {\f1{}=}: it defines a recursively-expanded variable.  However, when there {\i is} a previous definition, exactly what {\f1{}+=} does depends on what flavor of variable you defined originally.  See {\uldb The Two Flavors of Variables}{\v Flavors}, for an explanation of the two flavors of variables.\par
\par
\pard{}When you add to a variable's value with {\f1{}+=}, {\f1{}make} acts essentially as if you had included the extra text in the initial definition of the variable.  If you defined it first with {\f1{}:=}, making it a simply-expanded variable, {\f1{}+=} adds to that simply-expanded definition, and expands the new text before appending it to the old value just as {\f1{}:=} does (see {\uldb Setting Variables}{\v Setting}, for a full explanation of {\f1{}:=}).  In fact,\par
\par
{\pard\keep\li720\f1{}variable := value\line
variable += more\par
\pard\f0{}}\par
\pard{}is exactly equivalent to:\par
\par
{\pard\keep\li720\f1{}variable := value\line
variable := $(variable) more\par
\pard\f0{}}\par
\pard{}On the other hand, when you use {\f1{}+=} with a variable that you defined first to be recursively-expanded using plain {\f1{}=}, {\f1{}make} does something a bit different.  Recall that when you define a recursively-expanded variable, {\f1{}make} does not expand the value you set for variable and function references immediately.  Instead it stores the text verbatim, and saves these variable and function references to be expanded later, when you refer to the new variable (see {\uldb The Two Flavors of Variables}{\v Flavors}).  When you use {\f1{}+=} on a recursively-expanded variable, it is this unexpanded text to which {\f1{}make} appends the new text you specify.\par
\par
{{\pard\keep\li720\f1{}variable = value\line
variable += more\par
\pard\keep\li720{}}}\par
\pard\f0{}is roughly equivalent to:\par
\par
{{\pard\keep\li720\f1{}temp = value\line
variable = $(temp) more\par
\pard\keep\li720{}}}\par
\pard\f0{}except that of course it never defines a variable called {\f1{}temp}.  The importance of this comes when the variable's old value contains variable references.  Take this common example:\par
\par
{\pard\keep\li720\f1{}CFLAGS = $(includes) -O\line
...\line
CFLAGS += -pg # enable profiling\par
\pard\f0{}}\par
\pard{}The first line defines the {\f1{}CFLAGS} variable with a reference to another variable, {\f1{}includes}.  ({\f1{}CFLAGS} is used by the rules for C compilation; see {\uldb Catalogue of Implicit Rules}{\v Catalogue_of_Rules}.)  Using {\f1{}=} for the definition makes {\f1{}CFLAGS} a recursively-expanded variable, meaning {\f1{}$(includes) -O} is {\i not} expanded when {\f1{}make} processes the definition of {\f1{}CFLAGS}.  Thus, {\f1{}includes} need not be defined yet for its value to take effect.  It only has to be defined before any reference to {\f1{}CFLAGS}.  If we tried to append to the value of {\f1{}CFLAGS} without using {\f1{}+=}, we might do it like this:\par
\par
{\pard\keep\li720\f1{}CFLAGS := $(CFLAGS) -pg # enable profiling\par
\pard\f0{}}\par
\pard{}This is pretty close, but not quite what we want.  Using {\f1{}:=} redefines {\f1{}CFLAGS} as a simply-expanded variable; this means {\f1{}make} expands the text {\f1{}$(CFLAGS) -pg} before setting the variable.  If {\f1{}includes} is not yet defined, we get {\f1{} -O -pg}, and a later definition of {\f1{}includes} will have no effect.  Conversely, by using {\f1{}+=} we set {\f1{}CFLAGS} to the {\i unexpanded} value {\f1{}$(includes) -O -pg}.  Thus we preserve the reference to {\f1{}includes}, so if that variable gets defined at any later point, a reference like {\f1{}$(CFLAGS)} still uses its value.\par
\par
\page\pard Node: {\b Override Directive}, \keepn Next: {\uldb Defining}{\v Defining}, Prev: {\uldb Appending}{\v Appending}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Override Directive}
#{\footnote Override_Directive}
${\footnote \pard{}The {\f1{}override} Directive}\par
\pard{\fs24\b The {\f1{}override} Directive}\par
\par
\pard{}{K{\footnote K override}}{K{\footnote K overriding with {\f1{}override}}}{K{\footnote K variables, overriding}} If a variable has been set with a command argument (see {\uldb Overriding Variables}{\v Overriding}), then ordinary assignments in the makefile are ignored.  If you want to set the variable in the makefile even though it was set with a command argument, you can use an {\f1{}override} directive, which is a line that looks like this:\par
\par
{\pard\keep\li720\f1{}override {\i variable} = {\i value}\par
\pard\f0{}}\par
\pard{}or\par
\par
{\pard\keep\li720\f1{}override {\i variable} := {\i value}\par
\pard\f0{}}\par
\pard{}To append more text to a variable defined on the command line, use:\par
\par
{\pard\keep\li720\f1{}override {\i variable} += {\i more text}\par
\pard\f0{}}\par
\pard{}See {\uldb Appending More Text to Variables}{\v Appending}.\par
\par
\pard{}The {\f1{}override} directive was not invented for escalation in the war between makefiles and command arguments.  It was invented so you can alter and add to values that the user specifies with command arguments.\par
\par
\pard{}For example, suppose you always want the {\f1{}-g} switch when you run the C compiler, but you would like to allow the user to specify the other switches with a command argument just as usual.  You could use this {\f1{}override} directive:\par
\par
{\pard\keep\li720\f1{}override CFLAGS += -g\par
\pard\f0{}}\par
\pard{}You can also use {\f1{}override} directives with {\f1{}define} directives.  This is done as you might expect:\par
\par
{\pard\keep\li720\f1{}override define foo\line
bar\line
endef\par
\pard\f0{}}\par
{\pard{}See {\uldb Defining Variables Verbatim}{\v Defining}.  }\par
\par
\page\pard Node: {\b Defining}, \keepn Next: {\uldb Environment}{\v Environment}, Prev: {\uldb Override Directive}{\v Override_Directive}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Defining}
#{\footnote Defining}
${\footnote \pard{}Defining Variables Verbatim}\par
\pard{\fs24\b Defining Variables Verbatim}\par
\par
\pard{}{K{\footnote K define}}{K{\footnote K endef}}{K{\footnote K verbatim variable definition}}{K{\footnote K defining variables verbatim}}{K{\footnote K variables, defining verbatim}} Another way to set the value of a variable is to use the {\f1{}define} directive.  This directive has an unusual syntax which allows newline characters to be included in the value, which is convenient for defining canned sequences of commands (see {\uldb Defining Canned Command Sequences}{\v Sequences}).\par
\par
\pard{}The {\f1{}define} directive is followed on the same line by the name of the variable and nothing more.  The value to give the variable appears on the following lines.  The end of the value is marked by a line containing just the word {\f1{}endef}.  Aside from this difference in syntax, {\f1{}define} works just like {\f1{}=}: it creates a recursively-expanded variable (see {\uldb The Two Flavors of Variables}{\v Flavors}).  The variable name may contain function and variable references, which are expanded when the directive is read to find the actual variable name to use.\par
\par
{\pard\keep\li720\f1{}define two-lines\line
echo foo\line
echo $(bar)\line
endef\par
\pard\f0{}}\par
\pard{}The value in an ordinary assignment cannot contain a newline; but the newlines that separate the lines of the value in a {\f1{}define} become part of the variable's value (except for the final newline which precedes the {\f1{}endef} and is not considered part of the value).\par
\par
\pard{}The previous example is functionally equivalent to this:\par
\par
{\pard\keep\li720\f1{}two-lines = echo foo; echo $(bar)\par
\pard\f0{}}\par
\pard{}since two commands separated by semicolon behave much like two separate shell commands.  However, note that using two separate lines means {\f1{}make} will invoke the shell twice, running an independent subshell for each line.  See {\uldb Command Execution}{\v Execution}.\par
\par
\pard{}If you want variable definitions made with {\f1{}define} to take precedence over command-line variable definitions, you can use the {\f1{}override} directive together with {\f1{}define}:\par
\par
{\pard\keep\li720\f1{}override define two-lines\line
foo\line
$(bar)\line
endef\par
\pard\f0{}}\par
\pard{}See {\uldb The {\f1{}override} Directive}{\v Override_Directive}.\par
\par
\page\pard Node: {\b Environment}, \keepn Next: {\uldb Target-specific}{\v Target_specific}, Prev: {\uldb Defining}{\v Defining}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Environment}
#{\footnote Environment}
${\footnote \pard{}Variables from the Environment}\par
\pard{\fs24\b Variables from the Environment}\par
\par
\pard{}{K{\footnote K variables, environment}}{K{\footnote K environment}}Variables in {\f1{}make} can come from the environment in which {\f1{}make} is run.  Every environment variable that {\f1{}make} sees when it starts up is transformed into a {\f1{}make} variable with the same name and value.  But an explicit assignment in the makefile, or with a command argument, overrides the environment.  (If the {\f1{}-e} flag is specified, then values from the environment override assignments in the makefile.  See {\uldb Summary of Options}{\v Options_Summary}.  But this is not recommended practice.)\par
\par
\pard{}Thus, by setting the variable {\f1{}CFLAGS} in your environment, you can cause all C compilations in most makefiles to use the compiler switches you prefer.  This is safe for variables with standard or conventional meanings because you know that no makefile will use them for other things.  (But this is not totally reliable; some makefiles set {\f1{}CFLAGS} explicitly and therefore are not affected by the value in the environment.)\par
\par
\pard{}When {\f1{}make} is invoked recursively, variables defined in the outer invocation can be passed to inner invocations through the environment (see {\uldb Recursive Use of {\f1{}make}}{\v Recursion}).  By default, only variables that came from the environment or the command line are passed to recursive invocations.  You can use the {\f1{}export} directive to pass other variables.  See {\uldb Communicating Variables to a\'5Cline Sub-{\f1{}make}}{\v Variables_Recursion}, for full details.\par
\par
\pard{}Other use of variables from the environment is not recommended.  It is not wise for makefiles to depend for their functioning on environment variables set up outside their control, since this would cause different users to get different results from the same makefile.  This is against the whole purpose of most makefiles.\par
\par
\pard{}Such problems would be especially likely with the variable {\f1{}SHELL}, which is normally present in the environment to specify the user's choice of interactive shell.  It would be very undesirable for this choice to affect {\f1{}make}.  So {\f1{}make} ignores the environment value of {\f1{}SHELL} (except on MS-DOS and MS-Windows, where {\f1{}SHELL} is usually not set.  See {\uldb Special handling of SHELL on MS-DOS}{\v Execution}.)\par
\par
\page\pard Node: {\b Target-specific}, \keepn Next: {\uldb Pattern-specific}{\v Pattern_specific}, Prev: {\uldb Environment}{\v Environment}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Target-specific}
#{\footnote Target_specific}
${\footnote \pard{}Target-specific Variable Values}\par
\pard{\fs24\b Target-specific Variable Values}\par
\par
\pard{}{K{\footnote K target-specific variables}}{K{\footnote K variables, target-specific}} Variable values in {\f1{}make} are usually global; that is, they are the same regardless of where they are evaluated (unless they're reset, of course).  One exception to that is automatic variables (see {\uldb Automatic Variables}{\v Automatic}).\par
\par
\pard{}The other exception is \'A2target-specific variable values\'A2.  This feature allows you to define different values for the same variable, based on the target that {\f1{}make} is currently building.  As with automatic variables, these values are only available within the context of a target's command script (and in other target-specific assignments).\par
\par
\pard{}Set a target-specific variable value like this:\par
\par
{{\i \pard\li720\f1{}target} ... : {\i variable-assignment}\par
\pard\f0{}}\par
\pard{}or like this:\par
\par
{{\i \pard\li720\f1{}target} ... : override {\i variable-assignment}\par
\pard\f0{}}\par
\pard{}Multiple {\i target} values create a target-specific variable value for each member of the target list individually.\par
\par
\pard{}The {\i variable-assignment} can be any valid form of assignment; recursive ({\f1{}=}), static ({\f1{}:=}), appending ({\f1{}+=}), or conditional ({\f1{}?=}).  All variables that appear within the {\i variable-assignment} are evaluated within the context of the target: thus, any previously-defined target-specific variable values will be in effect.  Note that this variable is actually distinct from any "global" value: the two variables do not have to have the same flavor (recursive vs. static).\par
\par
\pard{}Target-specific variables have the same priority as any other makefile variable.  Variables provided on the command-line (and in the environment if the {\f1{}-e} option is in force) will take precedence.  Specifying the {\f1{}override} directive will allow the target-specific variable value to be preferred.\par
\par
\pard{}There is one more special feature of target-specific variables: when you define a target-specific variable, that variable value is also in effect for all prerequisites of this target (unless those prerequisites override it with their own target-specific variable value).  So, for example, a statement like this:\par
\par
{\pard\keep\li720\f1{}prog : CFLAGS = -g\line
prog : prog.o foo.o bar.o\par
\pard\f0{}}\par
\pard{}will set {\f1{}CFLAGS} to {\f1{}-g} in the command script for {\f1{}prog}, but it will also set {\f1{}CFLAGS} to {\f1{}-g} in the command scripts that create {\f1{}prog.o}, {\f1{}foo.o}, and {\f1{}bar.o}, and any command scripts which create their prerequisites.\par
\par
\page\pard Node: {\b Pattern-specific}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Target-specific}{\v Target_specific}, Up: {\uldb Using Variables}{\v Using_Variables}\line
K{\footnote K Pattern-specific}
#{\footnote Pattern_specific}
${\footnote \pard{}Pattern-specific Variable Values}\par
\pard{\fs24\b Pattern-specific Variable Values}\par
\par
\pard{}{K{\footnote K pattern-specific variables}}{K{\footnote K variables, pattern-specific}} In addition to target-specific variable values (see {\uldb Target-specific Variable Values}{\v Target_specific}), GNU {\f1{}make} supports pattern-specific variable values.  In this form, a variable is defined for any target that matches the pattern specified.  Variables defined in this way are searched after any target-specific variables defined explicitly for that target, and before target-specific variables defined for the parent target.\par
\par
\pard{}Set a pattern-specific variable value like this:\par
\par
{{\i \pard\li720\f1{}pattern} ... : {\i variable-assignment}\par
\pard\f0{}}\par
\pard{}or like this:\par
\par
{{\i \pard\li720\f1{}pattern} ... : override {\i variable-assignment}\par
\pard\f0{}}\par
\pard{}where {\i pattern} is a %-pattern.  As with target-specific variable values, multiple {\i pattern} values create a pattern-specific variable value for each pattern individually.  The {\i variable-assignment} can be any valid form of assignment.  Any command-line variable setting will take precedence, unless {\f1{}override} is specified.\par
\par
\pard{}For example:\par
\par
{\pard\keep\li720\f1{}%.o : CFLAGS = -O\par
\pard\f0{}}\par
\pard{}will assign {\f1{}CFLAGS} the value of {\f1{}-O} for all targets matching the pattern {\f1{}%.o}.\par
\par
\page\pard Node: {\b Conditionals}, \keepn Next: {\uldb Functions}{\v Functions}, Prev: {\uldb Using Variables}{\v Using_Variables}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Conditionals}
#{\footnote Conditionals}
${\footnote \pard{}Conditional Parts of Makefiles}\par
\pard{\fs24\b Conditional Parts of Makefiles}\par
\par
\pard{}{K{\footnote K conditionals}}A \'A2conditional\'A2 causes part of a makefile to be obeyed or ignored depending on the values of variables.  Conditionals can compare the value of one variable to another, or the value of a variable to a constant string.  Conditionals control what {\f1{}make} actually "sees" in the makefile, so they {\i cannot} be used to control shell commands at the time of execution.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Conditional Example}{\v Conditional_Example}\tab Example of a conditional\par
{\uldb Conditional Syntax}{\v Conditional_Syntax}\tab The syntax of conditionals.\par
{\uldb Testing Flags}{\v Testing_Flags}\tab Conditionals that test flags.\par
\pard{}}\par
\page\pard Node: {\b Conditional Example}, \keepn Next: {\uldb Conditional Syntax}{\v Conditional_Syntax}, Prev: {\uldb }{\v }, Up: {\uldb Conditionals}{\v Conditionals}\line
K{\footnote K Conditional Example}
#{\footnote Conditional_Example}
${\footnote \pard{}Example of a Conditional}\par
\pard{\fs24\b Example of a Conditional}\par
\par
\pard{}The following example of a conditional tells {\f1{}make} to use one set of libraries if the {\f1{}CC} variable is {\f1{}gcc}, and a different set of libraries otherwise.  It works by controlling which of two command lines will be used as the command for a rule.  The result is that {\f1{}CC=gcc} as an argument to {\f1{}make} changes not only which compiler is used but also which libraries are linked.\par
\par
{\pard\keep\li720\f1{}libs_for_gcc = -lgnu\line
normal_libs =\line
\line
foo: $(objects)\line
ifeq ($(CC),gcc)\line
        $(CC) -o foo $(objects) $(libs_for_gcc)\line
else\line
        $(CC) -o foo $(objects) $(normal_libs)\line
endif\par
\pard\f0{}}\par
\pard{}This conditional uses three directives: one {\f1{}ifeq}, one {\f1{}else} and one {\f1{}endif}.\par
\par
\pard{}The {\f1{}ifeq} directive begins the conditional, and specifies the condition.  It contains two arguments, separated by a comma and surrounded by parentheses.  Variable substitution is performed on both arguments and then they are compared.  The lines of the makefile following the {\f1{}ifeq} are obeyed if the two arguments match; otherwise they are ignored.\par
\par
\pard{}The {\f1{}else} directive causes the following lines to be obeyed if the previous conditional failed.  In the example above, this means that the second alternative linking command is used whenever the first alternative is not used.  It is optional to have an {\f1{}else} in a conditional.\par
\par
\pard{}The {\f1{}endif} directive ends the conditional.  Every conditional must end with an {\f1{}endif}.  Unconditional makefile text follows.\par
\par
\pard{}As this example illustrates, conditionals work at the textual level: the lines of the conditional are treated as part of the makefile, or ignored, according to the condition.  This is why the larger syntactic units of the makefile, such as rules, may cross the beginning or the end of the conditional.\par
\par
\pard{}When the variable {\f1{}CC} has the value {\f1{}gcc}, the above example has this effect:\par
\par
{\pard\keep\li720\f1{}foo: $(objects)\line
        $(CC) -o foo $(objects) $(libs_for_gcc)\par
\pard\f0{}}\par
\pard{}When the variable {\f1{}CC} has any other value, the effect is this:\par
\par
{\pard\keep\li720\f1{}foo: $(objects)\line
        $(CC) -o foo $(objects) $(normal_libs)\par
\pard\f0{}}\par
\pard{}Equivalent results can be obtained in another way by conditionalizing a variable assignment and then using the variable unconditionally:\par
\par
{\pard\keep\li720\f1{}libs_for_gcc = -lgnu\line
normal_libs =\line
\line
ifeq ($(CC),gcc)\line
  libs=$(libs_for_gcc)\line
else\line
  libs=$(normal_libs)\line
endif\line
\line
foo: $(objects)\line
        $(CC) -o foo $(objects) $(libs)\par
\pard\f0{}}\par
\page\pard Node: {\b Conditional Syntax}, \keepn Next: {\uldb Testing Flags}{\v Testing_Flags}, Prev: {\uldb Conditional Example}{\v Conditional_Example}, Up: {\uldb Conditionals}{\v Conditionals}\line
K{\footnote K Conditional Syntax}
#{\footnote Conditional_Syntax}
${\footnote \pard{}Syntax of Conditionals}\par
\pard{\fs24\b Syntax of Conditionals}\par
\par
\pard{}{K{\footnote K ifdef}}{K{\footnote K ifeq}}{K{\footnote K ifndef}}{K{\footnote K ifneq}}{K{\footnote K else}}{K{\footnote K endif}} The syntax of a simple conditional with no {\f1{}else} is as follows:\par
\par
{{\i \pard\li720\f1{}conditional-directive}\line
{\i text-if-true}\line
endif\par
\pard\f0{}}\par
\pard{}The {\i text-if-true} may be any lines of text, to be considered as part of the makefile if the condition is true.  If the condition is false, no text is used instead.\par
\par
\pard{}The syntax of a complex conditional is as follows:\par
\par
{{\i \pard\li720\f1{}conditional-directive}\line
{\i text-if-true}\line
else\line
{\i text-if-false}\line
endif\par
\pard\f0{}}\par
\pard{}If the condition is true, {\i text-if-true} is used; otherwise, {\i text-if-false} is used instead.  The {\i text-if-false} can be any number of lines of text.\par
\par
\pard{}The syntax of the {\i conditional-directive} is the same whether the conditional is simple or complex.  There are four different directives that test different conditions.  Here is a table of them:\par
\par
{\pard{}{\f1{}ifeq ({\i arg1}, {\i arg2})}\par
\pard{}{\f1{}ifeq '{\i arg1}' '{\i arg2}'}\par
\pard{}{\f1{}ifeq "{\i arg1}" "{\i arg2}"}\par
\pard{}{\f1{}ifeq "{\i arg1}" '{\i arg2}'}\par
\pard{}{\f1{}ifeq '{\i arg1}' "{\i arg2}"}\par
\pard\li720{}Expand all variable references in {\i arg1} and {\i arg2} and compare them.  If they are identical, the {\i text-if-true} is effective; otherwise, the {\i text-if-false}, if any, is effective.\par
\par
\pard\li720{}Often you want to test if a variable has a non-empty value.  When the value results from complex expansions of variables and functions, expansions you would consider empty may actually contain whitespace characters and thus are not seen as empty.  However, you can use the {\f1{}strip} function (see {\uldb Text Functions}{\v Text_Functions}) to avoid interpreting whitespace as a non-empty value.  For example:\par
\par
{{\pard\keep\li1440\f1{}ifeq ($(strip $(foo)),)\line
{\i text-if-empty}\line
endif\par
\pard\keep\li1440{}}}\par
\pard\li720\f0{}will evaluate {\i text-if-empty} even if the expansion of {\f1{}$(foo)} contains whitespace characters.\par
\par
\pard{}{\f1{}ifneq ({\i arg1}, {\i arg2})}\par
\pard{}{\f1{}ifneq '{\i arg1}' '{\i arg2}'}\par
\pard{}{\f1{}ifneq "{\i arg1}" "{\i arg2}"}\par
\pard{}{\f1{}ifneq "{\i arg1}" '{\i arg2}'}\par
\pard{}{\f1{}ifneq '{\i arg1}' "{\i arg2}"}\par
\pard\li720{}Expand all variable references in {\i arg1} and {\i arg2} and compare them.  If they are different, the {\i text-if-true} is effective; otherwise, the {\i text-if-false}, if any, is effective.\par
\par
\pard{}{\f1{}ifdef {\i variable-name}}\par
\pard\li720{}If the variable {\i variable-name} has a non-empty value, the {\i text-if-true} is effective; otherwise, the {\i text-if-false}, if any, is effective.  Variables that have never been defined have an empty value.\par
\par
\pard\li720{}Note that {\f1{}ifdef} only tests whether a variable has a value.  It does not expand the variable to see if that value is nonempty.  Consequently, tests using {\f1{}ifdef} return true for all definitions except those like {\f1{}foo =}.  To test for an empty value, use {\f1{}ifeq ($(foo),)}.  For example,\par
\par
{\pard\keep\li1440\f1{}bar =\line
foo = $(bar)\line
ifdef foo\line
frobozz = yes\line
else\line
frobozz = no\line
endif\par
\pard\li720\f0{}}\par
\pard\li720{}sets {\f1{}frobozz} to {\f1{}yes}, while:\par
\par
{\pard\keep\li1440\f1{}foo =\line
ifdef foo\line
frobozz = yes\line
else\line
frobozz = no\line
endif\par
\pard\li720\f0{}}\par
\pard\li720{}sets {\f1{}frobozz} to {\f1{}no}.\par
\par
\pard{}{\f1{}ifndef {\i variable-name}}\par
\pard\li720{}If the variable {\i variable-name} has an empty value, the {\i text-if-true} is effective; otherwise, the {\i text-if-false}, if any, is effective.\par
\pard{}}\par
\pard{}Extra spaces are allowed and ignored at the beginning of the conditional directive line, but a tab is not allowed.  (If the line begins with a tab, it will be considered a command for a rule.)  Aside from this, extra spaces or tabs may be inserted with no effect anywhere except within the directive name or within an argument.  A comment starting with {\f1{}#} may appear at the end of the line.\par
\par
\pard{}The other two directives that play a part in a conditional are {\f1{}else} and {\f1{}endif}.  Each of these directives is written as one word, with no arguments.  Extra spaces are allowed and ignored at the beginning of the line, and spaces or tabs at the end.  A comment starting with {\f1{}#} may appear at the end of the line.\par
\par
\pard{}Conditionals affect which lines of the makefile {\f1{}make} uses.  If the condition is true, {\f1{}make} reads the lines of the {\i text-if-true} as part of the makefile; if the condition is false, {\f1{}make} ignores those lines completely.  It follows that syntactic units of the makefile, such as rules, may safely be split across the beginning or the end of the conditional.\par
\par
{\f1{}\pard{}make} evaluates conditionals when it reads a makefile.  Consequently, you cannot use automatic variables in the tests of conditionals because they are not defined until commands are run (see {\uldb Automatic Variables}{\v Automatic}).\par
\par
\pard{}To prevent intolerable confusion, it is not permitted to start a conditional in one makefile and end it in another.  However, you may write an {\f1{}include} directive within a conditional, provided you do not attempt to terminate the conditional inside the included file.\par
\par
\page\pard Node: {\b Testing Flags}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Conditional Syntax}{\v Conditional_Syntax}, Up: {\uldb Conditionals}{\v Conditionals}\line
K{\footnote K Testing Flags}
#{\footnote Testing_Flags}
${\footnote \pard{}Conditionals that Test Flags}\par
\pard{\fs24\b Conditionals that Test Flags}\par
\par
\pard{}You can write a conditional that tests {\f1{}make} command flags such as {\f1{}-t} by using the variable {\f1{}MAKEFLAGS} together with the {\f1{}findstring} function (see {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}).  This is useful when {\f1{}touch} is not enough to make a file appear up to date.\par
\par
\pard{}The {\f1{}findstring} function determines whether one string appears as a substring of another.  If you want to test for the {\f1{}-t} flag, use {\f1{}t} as the first string and the value of {\f1{}MAKEFLAGS} as the other.\par
\par
\pard{}For example, here is how to arrange to use {\f1{}ranlib -t} to finish marking an archive file up to date:\par
\par
{\pard\keep\li720\f1{}archive.a: ...\line
ifneq (,$(findstring t,$(MAKEFLAGS)))\line
        +touch archive.a\line
        +ranlib -t archive.a\line
else\line
        ranlib archive.a\line
endif\par
\pard\f0{}}\par
\pard{}The {\f1{}+} prefix marks those command lines as "recursive" so that they will be executed despite use of the {\f1{}-t} flag.  See {\uldb Recursive Use of {\f1{}make}}{\v Recursion}.\par
\par
\page\pard Node: {\b Functions}, \keepn Next: {\uldb Running}{\v Running}, Prev: {\uldb Conditionals}{\v Conditionals}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Functions}
#{\footnote Functions}
${\footnote \pard{}Functions for Transforming Text}\par
\pard{\fs24\b Functions for Transforming Text}\par
\par
\pard{}{K{\footnote K functions}} \'A2Functions\'A2 allow you to do text processing in the makefile to compute the files to operate on or the commands to use.  You use a function in a \'A2function call\'A2, where you give the name of the function and some text (the \'A2arguments\'A2) for the function to operate on.  The result of the function's processing is substituted into the makefile at the point of the call, just as a variable might be substituted.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Syntax of Functions}{\v Syntax_of_Functions}\tab How to write a function call.\par
{\uldb Text Functions}{\v Text_Functions}\tab General-purpose text manipulation functions.\par
{\uldb File Name Functions}{\v File_Name_Functions}\tab Functions for manipulating file names.\par
{\uldb Foreach Function}{\v Foreach_Function}\tab Repeat some text with controlled variation.\par
{\uldb If Function}{\v If_Function}\tab Conditionally expand a value.\par
{\uldb Call Function}{\v Call_Function}\tab Expand a user-defined function.\par
{\uldb Origin Function}{\v Origin_Function}\tab Find where a variable got its value.\par
{\uldb Shell Function}{\v Shell_Function}\tab Substitute the output of a shell command.\par
{\uldb Make Control Functions}{\v Make_Control_Functions}\tab Functions that control how make runs.\par
\pard{}}\par
\page\pard Node: {\b Syntax of Functions}, \keepn Next: {\uldb Text Functions}{\v Text_Functions}, Prev: {\uldb }{\v }, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Syntax of Functions}
#{\footnote Syntax_of_Functions}
${\footnote \pard{}Function Call Syntax}\par
\pard{\fs24\b Function Call Syntax}\par
\par
\pard{}{K{\footnote K {\f1{}$}, in function call}}{K{\footnote K dollar sign ({\f1{}$}), in function call}}{K{\footnote K arguments of functions}}{K{\footnote K functions, syntax of}} A function call resembles a variable reference.  It looks like this:\par
\par
{\pard\keep\li720\f1{}$({\i function} {\i arguments})\par
\pard\f0{}}\par
\pard{}or like this:\par
\par
{\pard\keep\li720\f1{}$\'7B{\i function} {\i arguments}\'7D\par
\pard\f0{}}\par
\pard{}Here {\i function} is a function name; one of a short list of names that are part of {\f1{}make}.  You can also essentially create your own functions by using the {\f1{}call} builtin function.\par
\par
\pard{}The {\i arguments} are the arguments of the function.  They are separated from the function name by one or more spaces or tabs, and if there is more than one argument, then they are separated by commas.  Such whitespace and commas are not part of an argument's value.  The delimiters which you use to surround the function call, whether parentheses or braces, can appear in an argument only in matching pairs; the other kind of delimiters may appear singly.  If the arguments themselves contain other function calls or variable references, it is wisest to use the same kind of delimiters for all the references; write {\f1{}$(subst a,b,$(x))}, not {\f1{}$(subst a,b,$\'7Bx\'7D)}.  This is because it is clearer, and because only one type of delimiter is matched to find the end of the reference.\par
\par
\pard{}The text written for each argument is processed by substitution of variables and function calls to produce the argument value, which is the text on which the function acts.  The substitution is done in the order in which the arguments appear.\par
\par
\pard{}Commas and unmatched parentheses or braces cannot appear in the text of an argument as written; leading spaces cannot appear in the text of the first argument as written.  These characters can be put into the argument value by variable substitution.  First define variables {\f1{}comma} and {\f1{}space} whose values are isolated comma and space characters, then substitute these variables where such characters are wanted, like this:\par
\par
{{\pard\keep\li720\f1{}comma:= ,\line
empty:=\line
space:= $(empty) $(empty)\line
foo:= a b c\line
bar:= $(subst $(space),$(comma),$(foo))\line
# bar is now `a,b,c'.\par
\pard\keep\li720{}}}\par
\pard\f0{}Here the {\f1{}subst} function replaces each space with a comma, through the value of {\f1{}foo}, and substitutes the result.\par
\par
\page\pard Node: {\b Text Functions}, \keepn Next: {\uldb File Name Functions}{\v File_Name_Functions}, Prev: {\uldb Syntax of Functions}{\v Syntax_of_Functions}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Text Functions}
#{\footnote Text_Functions}
${\footnote \pard{}Functions for String Substitution and Analysis}\par
\pard{\fs24\b Functions for String Substitution and Analysis}\par
\par
\pard{}{K{\footnote K functions, for text}} Here are some functions that operate on strings:\par
\par
{\pard{}{\f1{}$(subst {\i from},{\i to},{\i text})}\par
\pard\li720{}{K{\footnote K subst}}Performs a textual replacement on the text {\i text}: each occurrence of {\i from} is replaced by {\i to}.  The result is substituted for the function call.  For example,\par
\par
{\pard\keep\li1440\f1{}$(subst ee,EE,feet on the street)\par
\pard\li720\f0{}}\par
\pard\li720{}substitutes the string {\f1{}fEEt on the strEEt}.\par
\par
\pard{}{\f1{}$(patsubst {\i pattern},{\i replacement},{\i text})}\par
\pard\li720{}{K{\footnote K patsubst}}Finds whitespace-separated words in {\i text} that match {\i pattern} and replaces them with {\i replacement}.  Here {\i pattern} may contain a {\f1{}%} which acts as a wildcard, matching any number of any characters within a word.  If {\i replacement} also contains a {\f1{}%}, the {\f1{}%} is replaced by the text that matched the {\f1{}%} in {\i pattern}.\par
\par
\pard\li720{}{K{\footnote K {\f1{}%}, quoting in {\f1{}patsubst}}}{K{\footnote K {\f1{}%}, quoting with {\f1{}\'5C} (backslash)}}{K{\footnote K {\f1{}\'5C} (backslash), to quote {\f1{}%}}}{K{\footnote K backslash ({\f1{}\'5C}), to quote {\f1{}%}}}{K{\footnote K quoting {\f1{}%}, in {\f1{}patsubst}}}{\f1{}%} characters in {\f1{}patsubst} function invocations can be quoted with preceding backslashes ({\f1{}\'5C}).  Backslashes that would otherwise quote {\f1{}%} characters can be quoted with more backslashes.  Backslashes that quote {\f1{}%} characters or other backslashes are removed from the pattern before it is compared file names or has a stem substituted into it.  Backslashes that are not in danger of quoting {\f1{}%} characters go unmolested.  For example, the pattern {\f1{}the\'5C%weird\'5C\'5C%pattern\'5C\'5C} has {\f1{}the%weird\'5C} preceding the operative {\f1{}%} character, and {\f1{}pattern\'5C\'5C} following it.  The final two backslashes are left alone because they cannot affect any {\f1{}%} character.\par
\par
\pard\li720{}Whitespace between words is folded into single space characters; leading and trailing whitespace is discarded.\par
\par
\pard\li720{}For example,\par
\par
{\pard\keep\li1440\f1{}$(patsubst %.c,%.o,x.c.c bar.c)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the value {\f1{}x.c.o bar.o}.\par
\par
\pard\li720{}Substitution references (see {\uldb Substitution References}{\v Substitution_Refs}) are a simpler way to get the effect of the {\f1{}patsubst} function:\par
\par
{\pard\keep\li1440\f1{}$({\i var}:{\i pattern}={\i replacement})\par
\pard\li720\f0{}}\par
\pard\li720{}is equivalent to\par
\par
{\pard\keep\li1440\f1{}$(patsubst {\i pattern},{\i replacement},$({\i var}))\par
\pard\li720\f0{}}\par
\pard\li720{}The second shorthand simplifies one of the most common uses of {\f1{}patsubst}: replacing the suffix at the end of file names.\par
\par
{\pard\keep\li1440\f1{}$({\i var}:{\i suffix}={\i replacement})\par
\pard\li720\f0{}}\par
\pard\li720{}is equivalent to\par
\par
{\pard\keep\li1440\f1{}$(patsubst %{\i suffix},%{\i replacement},$({\i var}))\par
\pard\li720\f0{}}\par
\pard\li720{}For example, you might have a list of object files:\par
\par
{\pard\keep\li1440\f1{}objects = foo.o bar.o baz.o\par
\pard\li720\f0{}}\par
\pard\li720{}To get the list of corresponding source files, you could simply write:\par
\par
{\pard\keep\li1440\f1{}$(objects:.o=.c)\par
\pard\li720\f0{}}\par
\pard\li720{}instead of using the general form:\par
\par
{\pard\keep\li1440\f1{}$(patsubst %.o,%.c,$(objects))\par
\pard\li720\f0{}}\par
\pard{}{\f1{}$(strip {\i string})}\par
\pard\li720{}{K{\footnote K stripping whitespace}}{K{\footnote K whitespace, stripping}}{K{\footnote K spaces, stripping}}{K{\footnote K strip}}Removes leading and trailing whitespace from {\i string} and replaces each internal sequence of one or more whitespace characters with a single space.  Thus, {\f1{}$(strip a b  c )} results in {\f1{}a b c}.\par
\par
\pard\li720{}The function {\f1{}strip} can be very useful when used in conjunction with conditionals.  When comparing something with the empty string {\f1{}} using {\f1{}ifeq} or {\f1{}ifneq}, you usually want a string of just whitespace to match the empty string (see {\uldb Conditionals}{\v Conditionals}).\par
\par
\pard\li720{}Thus, the following may fail to have the desired results:\par
\par
{\pard\keep\li1440\f1{}.PHONY: all\line
ifneq   "$(needs_made)" ""\line
all: $(needs_made)\line
else\line
all:;@echo 'Nothing to make!'\line
endif\par
\pard\li720\f0{}}\par
\pard\li720{}Replacing the variable reference {\f1{}$(needs_made)} with the function call {\f1{}$(strip $(needs_made))} in the {\f1{}ifneq} directive would make it more robust.\par
\par
\pard{}{\f1{}$(findstring {\i find},{\i in})}\par
\pard\li720{}{K{\footnote K findstring}}{K{\footnote K searching for strings}}{K{\footnote K finding strings}}{K{\footnote K strings, searching for}}Searches {\i in} for an occurrence of {\i find}.  If it occurs, the value is {\i find}; otherwise, the value is empty.  You can use this function in a conditional to test for the presence of a specific substring in a given string.  Thus, the two examples,\par
\par
{\pard\keep\li1440\f1{}$(findstring a,a b c)\line
$(findstring a,b c)\par
\pard\li720\f0{}}\par
\pard\li720{}produce the values {\f1{}a} and {\f1{}} (the empty string), respectively.  See {\uldb Testing Flags}{\v Testing_Flags}, for a practical application of {\f1{}findstring}.\par
\par
\pard\li720{}{K{\footnote K filter}}{K{\footnote K filtering words}}{K{\footnote K words, filtering}}\par
\par
\pard{}{\f1{}$(filter {\i pattern}...,{\i text})}\par
\pard\li720{}Returns all whitespace-separated words in {\i text} that {\i do} match any of the {\i pattern} words, removing any words that {\i do not} match.  The patterns are written using {\f1{}%}, just like the patterns used in the {\f1{}patsubst} function above.\par
\par
\pard\li720{}The {\f1{}filter} function can be used to separate out different types of strings (such as file names) in a variable.  For example:\par
\par
{\pard\keep\li1440\f1{}sources := foo.c bar.c baz.s ugh.h\line
foo: $(sources)\line
        cc $(filter %.c %.s,$(sources)) -o foo\par
\pard\li720\f0{}}\par
\pard\li720{}says that {\f1{}foo} depends of {\f1{}foo.c}, {\f1{}bar.c}, {\f1{}baz.s} and {\f1{}ugh.h} but only {\f1{}foo.c}, {\f1{}bar.c} and {\f1{}baz.s} should be specified in the command to the compiler.\par
\par
\pard{}{\f1{}$(filter-out {\i pattern}...,{\i text})}\par
\pard\li720{}{K{\footnote K filter-out}}{K{\footnote K filtering out words}}{K{\footnote K words, filtering out}}Returns all whitespace-separated words in {\i text} that {\i do not} match any of the {\i pattern} words, removing the words that {\i do} match one or more.  This is the exact opposite of the {\f1{}filter} function.\par
\par
\pard\li720{}Removes all whitespace-separated words in {\i text} that {\i do} match the {\i pattern} words, returning only the words that {\i do not} match.  This is the exact opposite of the {\f1{}filter} function.\par
\par
\pard\li720{}For example, given:\par
\par
{{\pard\keep\li1440\f1{}objects=main1.o foo.o main2.o bar.o\line
mains=main1.o main2.o\par
\pard\keep\li1440{}}}\par
\pard\li720\f0{}the following generates a list which contains all the object files not in {\f1{}mains}:\par
\par
{\pard\keep\li1440\f1{}$(filter-out $(mains),$(objects))\par
\pard\li720\f0{}}\par
\pard\li720{}{K{\footnote K sort}}{K{\footnote K sorting words}}\par
\par
\pard{}{\f1{}$(sort {\i list})}\par
\pard\li720{}Sorts the words of {\i list} in lexical order, removing duplicate words.  The output is a list of words separated by single spaces.  Thus,\par
\par
{\pard\keep\li1440\f1{}$(sort foo bar lose)\par
\pard\li720\f0{}}\par
\pard\li720{}returns the value {\f1{}bar foo lose}.\par
\par
\pard\li720{}{K{\footnote K removing duplicate words}}{K{\footnote K duplicate words, removing}}{K{\footnote K words, removing duplicates}}Incidentally, since {\f1{}sort} removes duplicate words, you can use it for this purpose even if you don't care about the sort order.\par
\pard{}}\par
\pard{}Here is a realistic example of the use of {\f1{}subst} and {\f1{}patsubst}.  Suppose that a makefile uses the {\f1{}VPATH} variable to specify a list of directories that {\f1{}make} should search for prerequisite files (see {\uldb {\f1{}VPATH} Search Path for All Prerequisites}{\v General_Search}).  This example shows how to tell the C compiler to search for header files in the same list of directories.\par
\par
\pard{}The value of {\f1{}VPATH} is a list of directories separated by colons, such as {\f1{}src:../headers}.  First, the {\f1{}subst} function is used to change the colons to spaces:\par
\par
{\pard\keep\li720\f1{}$(subst :, ,$(VPATH))\par
\pard\f0{}}\par
\pard{}This produces {\f1{}src ../headers}.  Then {\f1{}patsubst} is used to turn each directory name into a {\f1{}-I} flag.  These can be added to the value of the variable {\f1{}CFLAGS}, which is passed automatically to the C compiler, like this:\par
\par
{\pard\keep\li720\f1{}override CFLAGS += $(patsubst %,-I%,$(subst :, ,$(VPATH)))\par
\pard\f0{}}\par
\pard{}The effect is to append the text {\f1{}-Isrc -I../headers} to the previously given value of {\f1{}CFLAGS}.  The {\f1{}override} directive is used so that the new value is assigned even if the previous value of {\f1{}CFLAGS} was specified with a command argument (see {\uldb The {\f1{}override} Directive}{\v Override_line_Directive}).\par
\par
\page\pard Node: {\b File Name Functions}, \keepn Next: {\uldb Foreach Function}{\v Foreach_Function}, Prev: {\uldb Text Functions}{\v Text_Functions}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K File Name Functions}
#{\footnote File_Name_Functions}
${\footnote \pard{}Functions for File Names}\par
\pard{\fs24\b Functions for File Names}\par
\par
\pard{}{K{\footnote K functions, for file names}}{K{\footnote K file name functions}} Several of the built-in expansion functions relate specifically to taking apart file names or lists of file names.\par
\par
\pard{}Each of the following functions performs a specific transformation on a file name.  The argument of the function is regarded as a series of file names, separated by whitespace.  (Leading and trailing whitespace is ignored.)  Each file name in the series is transformed in the same way and the results are concatenated with single spaces between them.\par
\par
{\pard{}{\f1{}$(dir {\i names}...)}\par
\pard\li720{}{K{\footnote K dir}}{K{\footnote K directory part}}{K{\footnote K file name, directory part}}Extracts the directory-part of each file name in {\i names}.  The directory-part of the file name is everything up through (and including) the last slash in it.  If the file name contains no slash, the directory part is the string {\f1{}./}.  For example,\par
\par
{\pard\keep\li1440\f1{}$(dir src/foo.c hacks)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}src/ ./}.\par
\par
\pard{}{\f1{}$(notdir {\i names}...)}\par
\pard\li720{}{K{\footnote K notdir}}{K{\footnote K file name, nondirectory part}}{K{\footnote K nondirectory part}}Extracts all but the directory-part of each file name in {\i names}.  If the file name contains no slash, it is left unchanged.  Otherwise, everything through the last slash is removed from it.\par
\par
\pard\li720{}A file name that ends with a slash becomes an empty string.  This is unfortunate, because it means that the result does not always have the same number of whitespace-separated file names as the argument had; but we do not see any other valid alternative.\par
\par
\pard\li720{}For example,\par
\par
{\pard\keep\li1440\f1{}$(notdir src/foo.c hacks)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}foo.c hacks}.\par
\par
\pard{}{\f1{}$(suffix {\i names}...)}\par
\pard\li720{}{K{\footnote K suffix}}{K{\footnote K suffix, function to find}}{K{\footnote K file name suffix}}Extracts the suffix of each file name in {\i names}.  If the file name contains a period, the suffix is everything starting with the last period.  Otherwise, the suffix is the empty string.  This frequently means that the result will be empty when {\i names} is not, and if {\i names} contains multiple file names, the result may contain fewer file names.\par
\par
\pard\li720{}For example,\par
\par
{\pard\keep\li1440\f1{}$(suffix src/foo.c src-1.0/bar.c hacks)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}.c .c}.\par
\par
\pard{}{\f1{}$(basename {\i names}...)}\par
\pard\li720{}{K{\footnote K basename}}{K{\footnote K basename}}{K{\footnote K file name, basename of}}Extracts all but the suffix of each file name in {\i names}.  If the file name contains a period, the basename is everything starting up to (and not including) the last period.  Periods in the directory part are ignored.  If there is no period, the basename is the entire file name.  For example,\par
\par
{\pard\keep\li1440\f1{}$(basename src/foo.c src-1.0/bar hacks)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}src/foo src-1.0/bar hacks}.\par
\par
\pard{}{\f1{}$(addsuffix {\i suffix},{\i names}...)}\par
\pard\li720{}{K{\footnote K addsuffix}}{K{\footnote K suffix, adding}}{K{\footnote K file name suffix, adding}}The argument {\i names} is regarded as a series of names, separated by whitespace; {\i suffix} is used as a unit.  The value of {\i suffix} is appended to the end of each individual name and the resulting larger names are concatenated with single spaces between them.  For example,\par
\par
{\pard\keep\li1440\f1{}$(addsuffix .c,foo bar)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}foo.c bar.c}.\par
\par
\pard{}{\f1{}$(addprefix {\i prefix},{\i names}...)}\par
\pard\li720{}{K{\footnote K addprefix}}{K{\footnote K prefix, adding}}{K{\footnote K file name prefix, adding}}The argument {\i names} is regarded as a series of names, separated by whitespace; {\i prefix} is used as a unit.  The value of {\i prefix} is prepended to the front of each individual name and the resulting larger names are concatenated with single spaces between them.  For example,\par
\par
{\pard\keep\li1440\f1{}$(addprefix src/,foo bar)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}src/foo src/bar}.\par
\par
\pard{}{\f1{}$(join {\i list1},{\i list2})}\par
\pard\li720{}{K{\footnote K join}}{K{\footnote K joining lists of words}}{K{\footnote K words, joining lists}}Concatenates the two arguments word by word: the two first words (one from each argument) concatenated form the first word of the result, the two second words form the second word of the result, and so on.  So the {\i n}th word of the result comes from the {\i n}th word of each argument.  If one argument has more words that the other, the extra words are copied unchanged into the result.\par
\par
\pard\li720{}For example, {\f1{}$(join a b,.c .o)} produces {\f1{}a.c b.o}.\par
\par
\pard\li720{}Whitespace between the words in the lists is not preserved; it is replaced with a single space.\par
\par
\pard\li720{}This function can merge the results of the {\f1{}dir} and {\f1{}notdir} functions, to produce the original list of files which was given to those two functions.\par
\par
\pard{}{\f1{}$(word {\i n},{\i text})}\par
\pard\li720{}{K{\footnote K word}}{K{\footnote K word, selecting a}}{K{\footnote K selecting a word}}Returns the {\i n}th word of {\i text}.  The legitimate values of {\i n} start from 1.  If {\i n} is bigger than the number of words in {\i text}, the value is empty.  For example,\par
\par
{\pard\keep\li1440\f1{}$(word 2, foo bar baz)\par
\pard\li720\f0{}}\par
\pard\li720{}returns {\f1{}bar}.\par
\par
\pard{}{\f1{}$(wordlist {\i s},{\i e},{\i text})}\par
\pard\li720{}{K{\footnote K wordlist}}{K{\footnote K words, selecting lists of}}{K{\footnote K selecting word lists}}Returns the list of words in {\i text} starting with word {\i s} and ending with word {\i e} (inclusive).  The legitimate values of {\i s} and {\i e} start from 1.  If {\i s} is bigger than the number of words in {\i text}, the value is empty.  If {\i e} is bigger than the number of words in {\i text}, words up to the end of {\i text} are returned.  If {\i s} is greater than {\i e}, {\f1{}make} swaps them for you.  For example,\par
\par
{\pard\keep\li1440\f1{}$(wordlist 2, 3, foo bar baz)\par
\pard\li720\f0{}}\par
\pard\li720{}returns {\f1{}bar baz}.\par
\par
\pard{}{\f1{}$(words {\i text})}\par
\pard\li720{}{K{\footnote K words}}{K{\footnote K words, finding number}}Returns the number of words in {\i text}.  Thus, the last word of {\i text} is {\f1{}$(word $(words {\i text}),{\i text})}.\par
\par
\pard{}{\f1{}$(firstword {\i names}...)}\par
\pard\li720{}{K{\footnote K firstword}}{K{\footnote K words, extracting first}}The argument {\i names} is regarded as a series of names, separated by whitespace.  The value is the first name in the series.  The rest of the names are ignored.\par
\par
\pard\li720{}For example,\par
\par
{\pard\keep\li1440\f1{}$(firstword foo bar)\par
\pard\li720\f0{}}\par
\pard\li720{}produces the result {\f1{}foo}.  Although {\f1{}$(firstword {\i text})} is the same as {\f1{}$(word 1,{\i text})}, the {\f1{}firstword} function is retained for its simplicity.\par
\par
\pard{}{\f1{}$(wildcard {\i pattern})}\par
\pard\li720{}{K{\footnote K wildcard}}{K{\footnote K wildcard, function}}The argument {\i pattern} is a file name pattern, typically containing wildcard characters (as in shell file name patterns).  The result of {\f1{}wildcard} is a space-separated list of the names of existing files that match the pattern.  See {\uldb Using Wildcard Characters in File Names}{\v Wildcards}.\par
\pard{}}\par
\page\pard Node: {\b Foreach Function}, \keepn Next: {\uldb If Function}{\v If_Function}, Prev: {\uldb File Name Functions}{\v File_Name_Functions}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Foreach Function}
#{\footnote Foreach_Function}
${\footnote \pard{}The {\f1{}foreach} Function}\par
\pard{\fs24\b The {\f1{}foreach} Function}\par
\par
\pard{}{K{\footnote K foreach}}{K{\footnote K words, iterating over}} The {\f1{}foreach} function is very different from other functions.  It causes one piece of text to be used repeatedly, each time with a different substitution performed on it.  It resembles the {\f1{}for} command in the shell {\f1{}sh} and the {\f1{}foreach} command in the C-shell {\f1{}csh}.\par
\par
\pard{}The syntax of the {\f1{}foreach} function is:\par
\par
{\pard\keep\li720\f1{}$(foreach {\i var},{\i list},{\i text})\par
\pard\f0{}}\par
\pard{}The first two arguments, {\i var} and {\i list}, are expanded before anything else is done; note that the last argument, {\i text}, is {\b not} expanded at the same time.  Then for each word of the expanded value of {\i list}, the variable named by the expanded value of {\i var} is set to that word, and {\i text} is expanded.  Presumably {\i text} contains references to that variable, so its expansion will be different each time.\par
\par
\pard{}The result is that {\i text} is expanded as many times as there are whitespace-separated words in {\i list}.  The multiple expansions of {\i text} are concatenated, with spaces between them, to make the result of {\f1{}foreach}.\par
\par
\pard{}This simple example sets the variable {\f1{}files} to the list of all files in the directories in the list {\f1{}dirs}:\par
\par
{\pard\keep\li720\f1{}dirs := a b c d\line
files := $(foreach dir,$(dirs),$(wildcard $(dir)/*))\par
\pard\f0{}}\par
\pard{}Here {\i text} is {\f1{}$(wildcard $(dir)/*)}.  The first repetition finds the value {\f1{}a} for {\f1{}dir}, so it produces the same result as {\f1{}$(wildcard a/*)}; the second repetition produces the result of {\f1{}$(wildcard b/*)}; and the third, that of {\f1{}$(wildcard c/*)}.\par
\par
\pard{}This example has the same result (except for setting {\f1{}dirs}) as the following example:\par
\par
{\pard\keep\li720\f1{}files := $(wildcard a/* b/* c/* d/*)\par
\pard\f0{}}\par
\pard{}When {\i text} is complicated, you can improve readability by giving it a name, with an additional variable:\par
\par
{\pard\keep\li720\f1{}find_files = $(wildcard $(dir)/*)\line
dirs := a b c d\line
files := $(foreach dir,$(dirs),$(find_files))\par
\pard\f0{}}\par
\pard{}Here we use the variable {\f1{}find_files} this way.  We use plain {\f1{}=} to define a recursively-expanding variable, so that its value contains an actual function call to be reexpanded under the control of {\f1{}foreach}; a simply-expanded variable would not do, since {\f1{}wildcard} would be called only once at the time of defining {\f1{}find_files}.\par
\par
\pard{}The {\f1{}foreach} function has no permanent effect on the variable {\i var}; its value and flavor after the {\f1{}foreach} function call are the same as they were beforehand.  The other values which are taken from {\i list} are in effect only temporarily, during the execution of {\f1{}foreach}.  The variable {\i var} is a simply-expanded variable during the execution of {\f1{}foreach}.  If {\i var} was undefined before the {\f1{}foreach} function call, it is undefined after the call.  See {\uldb The Two Flavors of Variables}{\v Flavors}.\par
\par
\pard{}You must take care when using complex variable expressions that result in variable names because many strange things are valid variable names, but are probably not what you intended.  For example,\par
\par
{\pard\keep\li720\f1{}files := $(foreach Esta escrito en espanol!,b c ch,$(find_files))\par
\pard\f0{}}\par
\pard{}might be useful if the value of {\f1{}find_files} references the variable whose name is {\f1{}Esta escrito en espanol!} (es un nombre bastante largo, no?), but it is more likely to be a mistake.\par
\par
\page\pard Node: {\b If Function}, \keepn Next: {\uldb Call Function}{\v Call_Function}, Prev: {\uldb Foreach Function}{\v Foreach_Function}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K If Function}
#{\footnote If_Function}
${\footnote \pard{}The {\f1{}if} Function}\par
\pard{\fs24\b The {\f1{}if} Function}\par
\par
\pard{}{K{\footnote K if}}{K{\footnote K conditional expansion}} The {\f1{}if} function provides support for conditional expansion in a functional context (as opposed to the GNU {\f1{}make} makefile conditionals such as {\f1{}ifeq} (see {\uldb Syntax of Conditionals}{\v Conditional_Syntax}).\par
\par
\pard{}An {\f1{}if} function call can contain either two or three arguments:\par
\par
{\pard\keep\li720\f1{}$(if {\i condition},{\i then-part}[,{\i else-part}])\par
\pard\f0{}}\par
\pard{}The first argument, {\i condition}, first has all preceding and trailing whitespace stripped, then is expanded.  If it expands to any non-empty string, then the condition is considered to be true.  If it expands to an empty string, the condition is considered to be false.\par
\par
\pard{}If the condition is true then the second argument, {\i then-part}, is evaluated and this is used as the result of the evaluation of the entire {\f1{}if} function.\par
\par
\pard{}If the condition is false then the third argument, {\i else-part}, is evaluated and this is the result of the {\f1{}if} function.  If there is no third argument, the {\f1{}if} function evaluates to nothing (the empty string).\par
\par
\pard{}Note that only one of the {\i then-part} or the {\i else-part} will be evaluated, never both.  Thus, either can contain side-effects (such as {\f1{}shell} function calls, etc.)\par
\par
\page\pard Node: {\b Call Function}, \keepn Next: {\uldb Origin Function}{\v Origin_Function}, Prev: {\uldb If Function}{\v If_Function}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Call Function}
#{\footnote Call_Function}
${\footnote \pard{}The {\f1{}call} Function}\par
\pard{\fs24\b The {\f1{}call} Function}\par
\par
\pard{}{K{\footnote K call}}{K{\footnote K functions, user defined}}{K{\footnote K user defined functions}} The {\f1{}call} function is unique in that it can be used to create new parameterized functions.  You can write a complex expression as the value of a variable, then use {\f1{}call} to expand it with different values.\par
\par
\pard{}The syntax of the {\f1{}call} function is:\par
\par
{\pard\keep\li720\f1{}$(call {\i variable},{\i param},{\i param},...)\par
\pard\f0{}}\par
\pard{}When {\f1{}make} expands this function, it assigns each {\i param} to temporary variables {\f1{}$(1)}, {\f1{}$(2)}, etc.  The variable {\f1{}$(0)} will contain {\i variable}.  There is no maximum number of parameter arguments.  There is no minimum, either, but it doesn't make sense to use {\f1{}call} with no parameters.\par
\par
\pard{}Then {\i variable} is expanded as a {\f1{}make} variable in the context of these temporary assignments.  Thus, any reference to {\f1{}$(1)} in the value of {\i variable} will resolve to the first {\i param} in the invocation of {\f1{}call}.\par
\par
\pard{}Note that {\i variable} is the {\i name} of a variable, not a {\i reference} to that variable.  Therefore you would not normally use a {\f1{}$} or parentheses when writing it.  (You can, however, use a variable reference in the name if you want the name not to be a constant.)\par
\par
\pard{}If {\i variable} is the name of a builtin function, the builtin function is always invoked (even if a {\f1{}make} variable by that name also exists).\par
\par
\pard{}Some examples may make this clearer.\par
\par
\pard{}This macro simply reverses its arguments:\par
\par
{\pard\keep\li720\f1{}reverse = $(2) $(1)\line
\line
foo = a b\line
bar = $(call reverse,$(foo))\par
\pard\f0{}}\par
\pard{}Here {\i bar} will contain {\f1{}b a}.\par
\par
\pard{}This one is slightly more interesting: it defines a macro to search for the first instance of a program in {\f1{}PATH}:\par
\par
{\pard\keep\li720\f1{}pathsearch = $(firstword $(wildcard $(addsufix /$(1),$(subst :, ,$(PATH)))))\line
\line
LS := $(call pathsearch,ls)\par
\pard\f0{}}\par
\pard{}Now the variable LS contains {\f1{}/bin/ls} or similar.\par
\par
\pard{}The {\f1{}call} function can be nested.  Each recursive invocation gets its own local values for {\f1{}$(1)}, etc. that mask the values of higher-level {\f1{}call}.  For example, here is an implementation of a \'A2map\'A2 function:\par
\par
{\pard\keep\li720\f1{}map = $(foreach a,$(2),$(call $(1),$(a)))\par
\pard\f0{}}\par
\pard{}Now you can {\i map} a function that normally takes only one argument, such as {\f1{}origin}, to multiple values in one step:\par
\par
{\pard\keep\li720\f1{}o = $(call map,origin,o map MAKE)\par
\pard\f0{}}\par
\pard{}and end up with {\i o} containing something like {\f1{}file file default}.\par
\par
\pard{}A final caution: be careful when adding whitespace to the arguments to {\f1{}call}.  As with other functions, any whitespace contained in the second and subsequent arguments is kept; this can cause strange effects.  It's generally safest to remove all extraneous whitespace when providing parameters to {\f1{}call}.\par
\par
\page\pard Node: {\b Origin Function}, \keepn Next: {\uldb Shell Function}{\v Shell_Function}, Prev: {\uldb Call Function}{\v Call_Function}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Origin Function}
#{\footnote Origin_Function}
${\footnote \pard{}The {\f1{}origin} Function}\par
\pard{\fs24\b The {\f1{}origin} Function}\par
\par
\pard{}{K{\footnote K origin}}{K{\footnote K variables, origin of}}{K{\footnote K origin of variable}} The {\f1{}origin} function is unlike most other functions in that it does not operate on the values of variables; it tells you something {\i about} a variable.  Specifically, it tells you where it came from.\par
\par
\pard{}The syntax of the {\f1{}origin} function is:\par
\par
{\pard\keep\li720\f1{}$(origin {\i variable})\par
\pard\f0{}}\par
\pard{}Note that {\i variable} is the {\i name} of a variable to inquire about; not a {\i reference} to that variable.  Therefore you would not normally use a {\f1{}$} or parentheses when writing it.  (You can, however, use a variable reference in the name if you want the name not to be a constant.)\par
\par
\pard{}The result of this function is a string telling you how the variable {\i variable} was defined:\par
\par
{\pard{}{\f1{}undefined}\par
\pard\li720{}if {\i variable} was never defined.\par
\par
\pard{}{\f1{}default}\par
\pard\li720{}if {\i variable} has a default definition, as is usual with {\f1{}CC} and so on.  See {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}.  Note that if you have redefined a default variable, the {\f1{}origin} function will return the origin of the later definition.\par
\par
\pard{}{\f1{}environment}\par
\pard\li720{}if {\i variable} was defined as an environment variable and the {\f1{}-e} option is {\i not} turned on (see {\uldb Summary of Options}{\v Options_Summary}).\par
\par
\pard{}{\f1{}environment override}\par
\pard\li720{}if {\i variable} was defined as an environment variable and the {\f1{}-e} option {\i is} turned on (see {\uldb Summary of Options}{\v Options_Summary}).\par
\par
\pard{}{\f1{}file}\par
\pard\li720{}if {\i variable} was defined in a makefile.\par
\par
\pard{}{\f1{}command line}\par
\pard\li720{}if {\i variable} was defined on the command line.\par
\par
\pard{}{\f1{}override}\par
\pard\li720{}if {\i variable} was defined with an {\f1{}override} directive in a makefile (see {\uldb The {\f1{}override} Directive}{\v Override_Directive}).\par
\par
\pard{}{\f1{}automatic}\par
\pard\li720{}if {\i variable} is an automatic variable defined for the execution of the commands for each rule (see {\uldb Automatic Variables}{\v Automatic}).\par
\pard{}}\par
\pard{}This information is primarily useful (other than for your curiosity) to determine if you want to believe the value of a variable.  For example, suppose you have a makefile {\f1{}foo} that includes another makefile {\f1{}bar}.  You want a variable {\f1{}bletch} to be defined in {\f1{}bar} if you run the command {\f1{}make -f bar}, even if the environment contains a definition of {\f1{}bletch}.  However, if {\f1{}foo} defined {\f1{}bletch} before including {\f1{}bar}, you do not want to override that definition.  This could be done by using an {\f1{}override} directive in {\f1{}foo}, giving that definition precedence over the later definition in {\f1{}bar}; unfortunately, the {\f1{}override} directive would also override any command line definitions.  So, {\f1{}bar} could include:\par
\par
{{\pard\keep\li720\f1{}ifdef bletch\line
ifeq "$(origin bletch)" "environment"\line
bletch = barf, gag, etc.\line
endif\line
endif\par
\pard\keep\li720{}}}\par
\pard\f0{}If {\f1{}bletch} has been defined from the environment, this will redefine it.\par
\par
\pard{}If you want to override a previous definition of {\f1{}bletch} if it came from the environment, even under {\f1{}-e}, you could instead write:\par
\par
{{\pard\keep\li720\f1{}ifneq "$(findstring environment,$(origin bletch))" ""\line
bletch = barf, gag, etc.\line
endif\par
\pard\keep\li720{}}}\par
\pard\f0{}Here the redefinition takes place if {\f1{}$(origin bletch)} returns either {\f1{}environment} or {\f1{}environment override}.  See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\page\pard Node: {\b Shell Function}, \keepn Next: {\uldb Make Control Functions}{\v Make_Control_Functions}, Prev: {\uldb Origin Function}{\v Origin_Function}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Shell Function}
#{\footnote Shell_Function}
${\footnote \pard{}The {\f1{}shell} Function}\par
\pard{\fs24\b The {\f1{}shell} Function}\par
\par
\pard{}{K{\footnote K shell}}{K{\footnote K commands, expansion}}{K{\footnote K backquotes}}{K{\footnote K shell command, function for}} The {\f1{}shell} function is unlike any other function except the {\f1{}wildcard} function (see {\uldb The Function {\f1{}wildcard}}{\v Wildcard_Function}) in that it communicates with the world outside of {\f1{}make}.\par
\par
\pard{}The {\f1{}shell} function performs the same function that backquotes ({\f1{}`}) perform in most shells: it does \'A2command expansion\'A2.  This means that it takes an argument that is a shell command and returns the output of the command.  The only processing {\f1{}make} does on the result, before substituting it into the surrounding text, is to convert each newline or carriage-return / newline pair to a single space.  It also removes the trailing (carriage-return and) newline, if it's the last thing in the result.\par
\par
\pard{}The commands run by calls to the {\f1{}shell} function are run when the function calls are expanded.  In most cases, this is when the makefile is read in.  The exception is that function calls in the commands of the rules are expanded when the commands are run, and this applies to {\f1{}shell} function calls like all others.\par
\par
\pard{}Here are some examples of the use of the {\f1{}shell} function:\par
\par
{\pard\keep\li720\f1{}contents := $(shell cat foo)\par
\pard\f0{}}\par
\pard{}sets {\f1{}contents} to the contents of the file {\f1{}foo}, with a space (rather than a newline) separating each line.\par
\par
{\pard\keep\li720\f1{}files := $(shell echo *.c)\par
\pard\f0{}}\par
\pard{}sets {\f1{}files} to the expansion of {\f1{}*.c}.  Unless {\f1{}make} is using a very strange shell, this has the same result as {\f1{}$(wildcard *.c)}.\par
\par
\page\pard Node: {\b Make Control Functions}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Shell Function}{\v Shell_Function}, Up: {\uldb Functions}{\v Functions}\line
K{\footnote K Make Control Functions}
#{\footnote Make_Control_Functions}
${\footnote \pard{}Functions That Control Make}\par
\pard{\fs24\b Functions That Control Make}\par
\par
\pard{}{K{\footnote K functions, for controlling make}}{K{\footnote K controlling make}} These functions control the way make runs.  Generally, they are used to provide information to the user of the makefile or to cause make to stop if some sort of environmental error is detected.\par
\par
{\pard{}{\f1{}$(error {\i text}...)}\par
\pard\li720{}{K{\footnote K error}}{K{\footnote K error, stopping on}}{K{\footnote K stopping make}}Generates a fatal error where the message is {\i text}.  Note that the error is generated whenever this function is evaluated.  So, if you put it inside a command script or on the right side of a recursive variable assignment, it won't be evaluated until later.  The {\i text} will be expanded before the error is generated.\par
\par
\pard\li720{}For example,\par
\par
{\pard\keep\li1440\f1{}ifdef ERROR1\line
$(error error is $(ERROR1))\line
endif\par
\pard\li720\f0{}}\par
\pard\li720{}will generate a fatal error during the read of the makefile if the {\f1{}make} variable {\f1{}ERROR1} is defined.  Or,\par
\par
{\pard\keep\li1440\f1{}ERR = $(error found an error!)\line
\line
.PHONY: err\line
err: ; $(ERR)\par
\pard\li720\f0{}}\par
\pard\li720{}will generate a fatal error while {\f1{}make} is running, if the {\f1{}err} target is invoked.\par
\par
\pard{}{\f1{}$(warning {\i text}...)}\par
\pard\li720{}{K{\footnote K warning}}{K{\footnote K warnings, printing}}{K{\footnote K printing user warnings}}This function works similarly to the {\f1{}error} function, above, except that {\f1{}make} doesn't exit.  Instead, {\i text} is expanded and the resulting message is displayed, but processing of the makefile continues.\par
\par
\pard\li720{}The result of the expansion of this function is the empty string.\par
\pard{}}\par
\page\pard Node: {\b Running}, \keepn Next: {\uldb Implicit Rules}{\v Implicit_Rules}, Prev: {\uldb Functions}{\v Functions}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Running}
#{\footnote Running}
${\footnote \pard{}How to Run {\f1{}make}}\par
\pard{\fs24\b How to Run {\f1{}make}}\par
\par
\pard{}A makefile that says how to recompile a program can be used in more than one way.  The simplest use is to recompile every file that is out of date.  Usually, makefiles are written so that if you run {\f1{}make} with no arguments, it does just that.\par
\par
\pard{}But you might want to update only some of the files; you might want to use a different compiler or different compiler options; you might want just to find out which files are out of date without changing them.\par
\par
\pard{}By giving arguments when you run {\f1{}make}, you can do any of these things and many others.\par
\par
\pard{}The exit status of {\f1{}make} is always one of three values: {\par
\pard{}{\f1{}0}\par
\pard\li720{}The exit status is zero if {\f1{}make} is successful.\par
\par
\pard{}{\f1{}2}\par
\pard\li720{}The exit status is two if {\f1{}make} encounters any errors.  It will print messages describing the particular errors.\par
\par
\pard{}{\f1{}1}\par
\pard\li720{}The exit status is one if you use the {\f1{}-q} flag and {\f1{}make} determines that some target is not already up to date.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\pard{}}\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Makefile Arguments}{\v Makefile_Arguments}\tab How to specify which makefile to use.\par
{\uldb Goals}{\v Goals}\tab How to use goal arguments to specify which parts of the makefile to use.\par
{\uldb Instead of Execution}{\v Instead_of_Execution}\tab How to use mode flags to specify what kind of thing to do with the commands in the makefile other than simply execute them.\par
{\uldb Avoiding Compilation}{\v Avoiding_Compilation}\tab How to avoid recompiling certain files.\par
{\uldb Overriding}{\v Overriding}\tab How to override a variable to specify an alternate compiler and other things.\par
{\uldb Testing}{\v Testing}\tab How to proceed past some errors, to test compilation.\par
{\uldb Options Summary}{\v Options_Summary}\tab Summary of Options\par
\pard{}}\par
\page\pard Node: {\b Makefile Arguments}, \keepn Next: {\uldb Goals}{\v Goals}, Prev: {\uldb }{\v }, Up: {\uldb Running}{\v Running}\line
K{\footnote K Makefile Arguments}
#{\footnote Makefile_Arguments}
${\footnote \pard{}Arguments to Specify the Makefile}\par
\pard{\fs24\b Arguments to Specify the Makefile}\par
\par
\pard{}{K{\footnote K {\f1{}--file}}}{K{\footnote K {\f1{}--makefile}}}{K{\footnote K {\f1{}-f}}} The way to specify the name of the makefile is with the {\f1{}-f} or {\f1{}--file} option ({\f1{}--makefile} also works).  For example, {\f1{}-f altmake} says to use the file {\f1{}altmake} as the makefile.\par
\par
\pard{}If you use the {\f1{}-f} flag several times and follow each {\f1{}-f} with an argument, all the specified files are used jointly as makefiles.\par
\par
\pard{}If you do not use the {\f1{}-f} or {\f1{}--file} flag, the default is to try {\f1{}GNUmakefile}, {\f1{}makefile}, and {\f1{}Makefile}, in that order, and use the first of these three which exists or can be made (see {\uldb Writing Makefiles}{\v Makefiles}).\par
\par
\page\pard Node: {\b Goals}, \keepn Next: {\uldb Instead of Execution}{\v Instead_of_Execution}, Prev: {\uldb Makefile Arguments}{\v Makefile_Arguments}, Up: {\uldb Running}{\v Running}\line
K{\footnote K Goals}
#{\footnote Goals}
${\footnote \pard{}Arguments to Specify the Goals}\par
\pard{\fs24\b Arguments to Specify the Goals}\par
\par
\pard{}{K{\footnote K goal, how to specify}} The \'A2goals\'A2 are the targets that {\f1{}make} should strive ultimately to update.  Other targets are updated as well if they appear as prerequisites of goals, or prerequisites of prerequisites of goals, etc.\par
\par
\pard{}By default, the goal is the first target in the makefile (not counting targets that start with a period).  Therefore, makefiles are usually written so that the first target is for compiling the entire program or programs they describe.  If the first rule in the makefile has several targets, only the first target in the rule becomes the default goal, not the whole list.\par
\par
\pard{}You can specify a different goal or goals with arguments to {\f1{}make}.  Use the name of the goal as an argument.  If you specify several goals, {\f1{}make} processes each of them in turn, in the order you name them.\par
\par
\pard{}Any target in the makefile may be specified as a goal (unless it starts with {\f1{}-} or contains an {\f1{}=}, in which case it will be parsed as a switch or variable definition, respectively).  Even targets not in the makefile may be specified, if {\f1{}make} can find implicit rules that say how to make them.\par
\par
\pard{}{K{\footnote K {\f1{}MAKECMDGOALS}}}{K{\footnote K MAKECMDGOALS}}{\f1{}Make} will set the special variable {\f1{}MAKECMDGOALS} to the list of goals you specified on the command line.  If no goals were given on the command line, this variable is empty.  Note that this variable should be used only in special circumstances.\par
\par
\pard{}An example of appropriate use is to avoid including {\f1{}.d} files during {\f1{}clean} rules (see {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}), so {\f1{}make} won't create them only to immediately remove them again:\par
\par
{{\pard\keep\li720\f1{}sources = foo.c bar.c\line
\line
ifneq ($(MAKECMDGOALS),clean)\line
include $(sources:.c=.d)\line
endif\par
\pard\keep\li720{}}}\par
\pard\f0{}One use of specifying a goal is if you want to compile only a part of the program, or only one of several programs.  Specify as a goal each file that you wish to remake.  For example, consider a directory containing several programs, with a makefile that starts like this:\par
\par
{\pard\keep\li720\f1{}.PHONY: all\line
all: size nm ld ar as\par
\pard\f0{}}\par
\pard{}If you are working on the program {\f1{}size}, you might want to say {\f1{}make size} so that only the files of that program are recompiled.\par
\par
\pard{}Another use of specifying a goal is to make files that are not normally made.  For example, there may be a file of debugging output, or a version of the program that is compiled specially for testing, which has a rule in the makefile but is not a prerequisite of the default goal.\par
\par
\pard{}Another use of specifying a goal is to run the commands associated with a phony target (see {\uldb Phony Targets}{\v Phony_Targets}) or empty target (see {\uldb Empty Target Files to Record Events}{\v Empty_Targets}).  Many makefiles contain a phony target named {\f1{}clean} which deletes everything except source files.  Naturally, this is done only if you request it explicitly with {\f1{}make clean}.  Following is a list of typical phony and empty target names.  See {\uldb Standard Targets}{\v Standard_Targets}, for a detailed list of all the standard target names which GNU software packages use.\par
\par
{\pard{}{\f1{}all}\par
\pard\li720{}{K{\footnote K {\f1{}all} (standard target)}}Make all the top-level targets the makefile knows about.\par
\par
\pard{}{\f1{}clean}\par
\pard\li720{}{K{\footnote K {\f1{}clean} (standard target)}}Delete all files that are normally created by running {\f1{}make}.\par
\par
\pard{}{\f1{}mostlyclean}\par
\pard\li720{}{K{\footnote K {\f1{}mostlyclean} (standard target)}}Like {\f1{}clean}, but may refrain from deleting a few files that people normally don't want to recompile.  For example, the {\f1{}mostlyclean} target for GCC does not delete {\f1{}libgcc.a}, because recompiling it is rarely necessary and takes a lot of time.\par
\par
\pard{}{\f1{}distclean}\par
\pard\li720{}{K{\footnote K {\f1{}distclean} (standard target)}}\par
\par
\pard{}{\f1{}realclean}\par
\pard\li720{}{K{\footnote K {\f1{}realclean} (standard target)}}\par
\par
\pard{}{\f1{}clobber}\par
\pard\li720{}{K{\footnote K {\f1{}clobber} (standard target)}}Any of these targets might be defined to delete {\i more} files than {\f1{}clean} does.  For example, this would delete configuration files or links that you would normally create as preparation for compilation, even if the makefile itself cannot create these files.\par
\par
\pard{}{\f1{}install}\par
\pard\li720{}{K{\footnote K {\f1{}install} (standard target)}}Copy the executable file into a directory that users typically search for commands; copy any auxiliary files that the executable uses into the directories where it will look for them.\par
\par
\pard{}{\f1{}print}\par
\pard\li720{}{K{\footnote K {\f1{}print} (standard target)}}Print listings of the source files that have changed.\par
\par
\pard{}{\f1{}tar}\par
\pard\li720{}{K{\footnote K {\f1{}tar} (standard target)}}Create a tar file of the source files.\par
\par
\pard{}{\f1{}shar}\par
\pard\li720{}{K{\footnote K {\f1{}shar} (standard target)}}Create a shell archive (shar file) of the source files.\par
\par
\pard{}{\f1{}dist}\par
\pard\li720{}{K{\footnote K {\f1{}dist} (standard target)}}Create a distribution file of the source files.  This might be a tar file, or a shar file, or a compressed version of one of the above, or even more than one of the above.\par
\par
\pard{}{\f1{}TAGS}\par
\pard\li720{}{K{\footnote K {\f1{}TAGS} (standard target)}}Update a tags table for this program.\par
\par
\pard{}{\f1{}check}\par
\pard\li720{}{K{\footnote K {\f1{}check} (standard target)}}\par
\par
\pard{}{\f1{}test}\par
\pard\li720{}{K{\footnote K {\f1{}test} (standard target)}}Perform self tests on the program this makefile builds.\par
\pard{}}\par
\page\pard Node: {\b Instead of Execution}, \keepn Next: {\uldb Avoiding Compilation}{\v Avoiding_Compilation}, Prev: {\uldb Goals}{\v Goals}, Up: {\uldb Running}{\v Running}\line
K{\footnote K Instead of Execution}
#{\footnote Instead_of_Execution}
${\footnote \pard{}Instead of Executing the Commands}\par
\pard{\fs24\b Instead of Executing the Commands}\par
\par
\pard{}{K{\footnote K execution, instead of}}{K{\footnote K commands, instead of executing}} The makefile tells {\f1{}make} how to tell whether a target is up to date, and how to update each target.  But updating the targets is not always what you want.  Certain options specify other activities for {\f1{}make}.\par
\par
{\pard{}{\f1{}-n}\par
\pard{}{\f1{}--just-print}\par
\pard{}{\f1{}--dry-run}\par
\pard{}{\f1{}--recon}\par
\pard\li720{}{K{\footnote K {\f1{}--just-print}}}{K{\footnote K {\f1{}--dry-run}}}{K{\footnote K {\f1{}--recon}}}{K{\footnote K {\f1{}-n}}} "No-op".  The activity is to print what commands would be used to make the targets up to date, but not actually execute them.\par
\par
\pard{}{\f1{}-t}\par
\pard{}{\f1{}--touch}\par
\pard\li720{}{K{\footnote K {\f1{}--touch}}}{K{\footnote K touching files}}{K{\footnote K target, touching}}{K{\footnote K {\f1{}-t}}} "Touch".  The activity is to mark the targets as up to date without actually changing them.  In other words, {\f1{}make} pretends to compile the targets but does not really change their contents.\par
\par
\pard{}{\f1{}-q}\par
\pard{}{\f1{}--question}\par
\pard\li720{}{K{\footnote K {\f1{}--question}}}{K{\footnote K {\f1{}-q}}}{K{\footnote K question mode}} "Question".  The activity is to find out silently whether the targets are up to date already; but execute no commands in either case.  In other words, neither compilation nor output will occur.\par
\par
\pard{}{\f1{}-W {\i file}}\par
\pard{}{\f1{}--what-if={\i file}}\par
\pard{}{\f1{}--assume-new={\i file}}\par
\pard{}{\f1{}--new-file={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--what-if}}}{K{\footnote K {\f1{}-W}}}{K{\footnote K {\f1{}--assume-new}}}{K{\footnote K {\f1{}--new-file}}}{K{\footnote K what if}}{K{\footnote K files, assuming new}} "What if".  Each {\f1{}-W} flag is followed by a file name.  The given files' modification times are recorded by {\f1{}make} as being the present time, although the actual modification times remain the same.  You can use the {\f1{}-W} flag in conjunction with the {\f1{}-n} flag to see what would happen if you were to modify specific files.\par
\pard{}}\par
\pard{}With the {\f1{}-n} flag, {\f1{}make} prints the commands that it would normally execute but does not execute them.\par
\par
\pard{}With the {\f1{}-t} flag, {\f1{}make} ignores the commands in the rules and uses (in effect) the command {\f1{}touch} for each target that needs to be remade.  The {\f1{}touch} command is also printed, unless {\f1{}-s} or {\f1{}.SILENT} is used.  For speed, {\f1{}make} does not actually invoke the program {\f1{}touch}.  It does the work directly.\par
\par
\pard{}With the {\f1{}-q} flag, {\f1{}make} prints nothing and executes no commands, but the exit status code it returns is zero if and only if the targets to be considered are already up to date.  If the exit status is one, then some updating needs to be done.  If {\f1{}make} encounters an error, the exit status is two, so you can distinguish an error from a target that is not up to date.\par
\par
\pard{}It is an error to use more than one of these three flags in the same invocation of {\f1{}make}.\par
\par
\pard{}The {\f1{}-n}, {\f1{}-t}, and {\f1{}-q} options do not affect command lines that begin with {\f1{}+} characters or contain the strings {\f1{}$(MAKE)} or {\f1{}$\'7BMAKE\'7D}.  Note that only the line containing the {\f1{}+} character or the strings {\f1{}$(MAKE)} or {\f1{}$\'7BMAKE\'7D} is run regardless of these options.  Other lines in the same rule are not run unless they too begin with {\f1{}+} or contain {\f1{}$(MAKE)} or {\f1{}$\'7BMAKE\'7D} (See {\uldb How the {\f1{}MAKE} Variable Works}{\v MAKE_Variable}.)\par
\par
\pard{}The {\f1{}-W} flag provides two features:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}If you also use the {\f1{}-n} or {\f1{}-q} flag, you can see what {\f1{}make} would do if you were to modify some files.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Without the {\f1{}-n} or {\f1{}-q} flag, when {\f1{}make} is actually executing commands, the {\f1{}-W} flag can direct {\f1{}make} to act as if some files had been modified, without actually modifying the files.\par
\pard{}}\par
\pard{}Note that the options {\f1{}-p} and {\f1{}-v} allow you to obtain other information about {\f1{}make} or about the makefiles in use (see {\uldb Summary of Options}{\v Options_Summary}).\par
\par
\page\pard Node: {\b Avoiding Compilation}, \keepn Next: {\uldb Overriding}{\v Overriding}, Prev: {\uldb Instead of Execution}{\v Instead_of_Execution}, Up: {\uldb Running}{\v Running}\line
K{\footnote K Avoiding Compilation}
#{\footnote Avoiding_Compilation}
${\footnote \pard{}Avoiding Recompilation of Some Files}\par
\pard{\fs24\b Avoiding Recompilation of Some Files}\par
\par
\pard{}{K{\footnote K {\f1{}-o}}}{K{\footnote K {\f1{}--old-file}}}{K{\footnote K {\f1{}--assume-old}}}{K{\footnote K files, assuming old}}{K{\footnote K files, avoiding recompilation of}}{K{\footnote K recompilation, avoiding}} Sometimes you may have changed a source file but you do not want to recompile all the files that depend on it.  For example, suppose you add a macro or a declaration to a header file that many other files depend on.  Being conservative, {\f1{}make} assumes that any change in the header file requires recompilation of all dependent files, but you know that they do not need to be recompiled and you would rather not waste the time waiting for them to compile.\par
\par
\pard{}If you anticipate the problem before changing the header file, you can use the {\f1{}-t} flag.  This flag tells {\f1{}make} not to run the commands in the rules, but rather to mark the target up to date by changing its last-modification date.  You would follow this procedure:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}1. \tab{}Use the command {\f1{}make} to recompile the source files that really need recompilation.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}2. \tab{}Make the changes in the header files.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}3. \tab{}Use the command {\f1{}make -t} to mark all the object files as up to date.  The next time you run {\f1{}make}, the changes in the header files will not cause any recompilation.\par
\pard{}}\par
\pard{}If you have already changed the header file at a time when some files do need recompilation, it is too late to do this.  Instead, you can use the {\f1{}-o {\i file}} flag, which marks a specified file as "old" (see {\uldb Summary of Options}{\v Options_Summary}).  This means that the file itself will not be remade, and nothing else will be remade on its account.  Follow this procedure:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}1. \tab{}Recompile the source files that need compilation for reasons independent of the particular header file, with {\f1{}make -o {\i headerfile}}.  If several header files are involved, use a separate {\f1{}-o} option for each header file.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}2. \tab{}Touch all the object files with {\f1{}make -t}.\par
\pard{}}\par
\page\pard Node: {\b Overriding}, \keepn Next: {\uldb Testing}{\v Testing}, Prev: {\uldb Avoiding Compilation}{\v Avoiding_Compilation}, Up: {\uldb Running}{\v Running}\line
K{\footnote K Overriding}
#{\footnote Overriding}
${\footnote \pard{}Overriding Variables}\par
\pard{\fs24\b Overriding Variables}\par
\par
\pard{}{K{\footnote K overriding variables with arguments}}{K{\footnote K variables, overriding with arguments}}{K{\footnote K command line variables}}{K{\footnote K variables, command line}} An argument that contains {\f1{}=} specifies the value of a variable: {\f1{}{\i v}={\i x}} sets the value of the variable {\i v} to {\i x}.  If you specify a value in this way, all ordinary assignments of the same variable in the makefile are ignored; we say they have been \'A2overridden\'A2 by the command line argument.\par
\par
\pard{}The most common way to use this facility is to pass extra flags to compilers.  For example, in a properly written makefile, the variable {\f1{}CFLAGS} is included in each command that runs the C compiler, so a file {\f1{}foo.c} would be compiled something like this:\par
\par
{\pard\keep\li720\f1{}cc -c $(CFLAGS) foo.c\par
\pard\f0{}}\par
\pard{}Thus, whatever value you set for {\f1{}CFLAGS} affects each compilation that occurs.  The makefile probably specifies the usual value for {\f1{}CFLAGS}, like this:\par
\par
{\pard\keep\li720\f1{}CFLAGS=-g\par
\pard\f0{}}\par
\pard{}Each time you run {\f1{}make}, you can override this value if you wish.  For example, if you say {\f1{}make CFLAGS='-g -O'}, each C compilation will be done with {\f1{}cc -c -g -O}.  (This illustrates how you can use quoting in the shell to enclose spaces and other special characters in the value of a variable when you override it.)\par
\par
\pard{}The variable {\f1{}CFLAGS} is only one of many standard variables that exist just so that you can change them this way.  See {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}, for a complete list.\par
\par
\pard{}You can also program the makefile to look at additional variables of your own, giving the user the ability to control other aspects of how the makefile works by changing the variables.\par
\par
\pard{}When you override a variable with a command argument, you can define either a recursively-expanded variable or a simply-expanded variable.  The examples shown above make a recursively-expanded variable; to make a simply-expanded variable, write {\f1{}:=} instead of {\f1{}=}.  But, unless you want to include a variable reference or function call in the {\i value} that you specify, it makes no difference which kind of variable you create.\par
\par
\pard{}There is one way that the makefile can change a variable that you have overridden.  This is to use the {\f1{}override} directive, which is a line that looks like this: {\f1{}override {\i variable} = {\i value}} (see {\uldb The {\f1{}override} Directive}{\v Override_Directive}).\par
\par
\page\pard Node: {\b Testing}, \keepn Next: {\uldb Options Summary}{\v Options_Summary}, Prev: {\uldb Overriding}{\v Overriding}, Up: {\uldb Running}{\v Running}\line
K{\footnote K Testing}
#{\footnote Testing}
${\footnote \pard{}Testing the Compilation of a Program}\par
\pard{\fs24\b Testing the Compilation of a Program}\par
\par
\pard{}{K{\footnote K testing compilation}}{K{\footnote K compilation, testing}} Normally, when an error happens in executing a shell command, {\f1{}make} gives up immediately, returning a nonzero status.  No further commands are executed for any target.  The error implies that the goal cannot be correctly remade, and {\f1{}make} reports this as soon as it knows.\par
\par
\pard{}When you are compiling a program that you have just changed, this is not what you want.  Instead, you would rather that {\f1{}make} try compiling every file that can be tried, to show you as many compilation errors as possible.\par
\par
\pard{}{K{\footnote K {\f1{}-k}}}{K{\footnote K {\f1{}--keep-going}}}On these occasions, you should use the {\f1{}-k} or {\f1{}--keep-going} flag.  This tells {\f1{}make} to continue to consider the other prerequisites of the pending targets, remaking them if necessary, before it gives up and returns nonzero status.  For example, after an error in compiling one object file, {\f1{}make -k} will continue compiling other object files even though it already knows that linking them will be impossible.  In addition to continuing after failed shell commands, {\f1{}make -k} will continue as much as possible after discovering that it does not know how to make a target or prerequisite file.  This will always cause an error message, but without {\f1{}-k}, it is a fatal error (see {\uldb Summary of Options}{\v Options_Summary}).\par
\par
\pard{}The usual behavior of {\f1{}make} assumes that your purpose is to get the goals up to date; once {\f1{}make} learns that this is impossible, it might as well report the failure immediately.  The {\f1{}-k} flag says that the real purpose is to test as much as possible of the changes made in the program, perhaps to find several independent problems so that you can correct them all before the next attempt to compile.  This is why Emacs' {\f1{}M-x compile} command passes the {\f1{}-k} flag by default.\par
\par
\page\pard Node: {\b Options Summary}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Testing}{\v Testing}, Up: {\uldb Running}{\v Running}\line
K{\footnote K Options Summary}
#{\footnote Options_Summary}
${\footnote \pard{}Summary of Options}\par
\pard{\fs24\b Summary of Options}\par
\par
\pard{}{K{\footnote K options}}{K{\footnote K flags}}{K{\footnote K switches}} Here is a table of all the options {\f1{}make} understands:\par
\par
{\pard{}{\f1{}-b}\par
\pard\li720{}{K{\footnote K {\f1{}-b}}}\par
\par
\pard{}{\f1{}-m}\par
\pard\li720{}{K{\footnote K {\f1{}-m}}}These options are ignored for compatibility with other versions of {\f1{}make}.\par
\par
\pard{}{\f1{}-C {\i dir}}\par
\pard\li720{}{K{\footnote K {\f1{}-C}}}\par
\par
\pard{}{\f1{}--directory={\i dir}}\par
\pard\li720{}{K{\footnote K {\f1{}--directory}}}Change to directory {\i dir} before reading the makefiles.  If multiple {\f1{}-C} options are specified, each is interpreted relative to the previous one: {\f1{}-C / -C etc} is equivalent to {\f1{}-C /etc}.  This is typically used with recursive invocations of {\f1{}make} (see {\uldb Recursive Use of {\f1{}make}}{\v Recursion}).\par
\par
\pard{}{\f1{}-d}\par
\pard\li720{}{K{\footnote K {\f1{}-d}}}\par
\par
\pard{}{\f1{}--debug}\par
\pard\li720{}{K{\footnote K {\f1{}--debug}}} Print debugging information in addition to normal processing.  The debugging information says which files are being considered for remaking, which file-times are being compared and with what results, which files actually need to be remade, which implicit rules are considered and which are applied--everything interesting about how {\f1{}make} decides what to do.\par
\par
\pard{}{\f1{}-e}\par
\pard\li720{}{K{\footnote K {\f1{}-e}}}\par
\par
\pard{}{\f1{}--environment-overrides}\par
\pard\li720{}{K{\footnote K {\f1{}--environment-overrides}}}Give variables taken from the environment precedence over variables from makefiles.  See {\uldb Variables from the Environment}{\v Environment}.\par
\par
\pard{}{\f1{}-f {\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}-f}}}\par
\par
\pard{}{\f1{}--file={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--file}}}\par
\par
\pard{}{\f1{}--makefile={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--makefile}}}Read the file named {\i file} as a makefile.  See {\uldb Writing Makefiles}{\v Makefiles}.\par
\par
\pard{}{\f1{}-h}\par
\pard\li720{}{K{\footnote K {\f1{}-h}}}\par
\par
\pard{}{\f1{}--help}\par
\pard\li720{}{K{\footnote K {\f1{}--help}}} Remind you of the options that {\f1{}make} understands and then exit.\par
\par
\pard{}{\f1{}-i}\par
\pard\li720{}{K{\footnote K {\f1{}-i}}}\par
\par
\pard{}{\f1{}--ignore-errors}\par
\pard\li720{}{K{\footnote K {\f1{}--ignore-errors}}}Ignore all errors in commands executed to remake files.  See {\uldb Errors in Commands}{\v Errors}.\par
\par
\pard{}{\f1{}-I {\i dir}}\par
\pard\li720{}{K{\footnote K {\f1{}-I}}}\par
\par
\pard{}{\f1{}--include-dir={\i dir}}\par
\pard\li720{}{K{\footnote K {\f1{}--include-dir}}}Specifies a directory {\i dir} to search for included makefiles.  See {\uldb Including Other Makefiles}{\v Include}.  If several {\f1{}-I} options are used to specify several directories, the directories are searched in the order specified.\par
\par
\pard{}{\f1{}-j [{\i jobs}]}\par
\pard\li720{}{K{\footnote K {\f1{}-j}}}\par
\par
\pard{}{\f1{}--jobs=[{\i jobs}]}\par
\pard\li720{}{K{\footnote K {\f1{}--jobs}}}Specifies the number of jobs (commands) to run simultaneously.  With no argument, {\f1{}make} runs as many jobs simultaneously as possible.  If there is more than one {\f1{}-j} option, the last one is effective.  See {\uldb Parallel Execution}{\v Parallel}, for more information on how commands are run.  Note that this option is ignored on MS-DOS.\par
\par
\pard{}{\f1{}-k}\par
\pard\li720{}{K{\footnote K {\f1{}-k}}}\par
\par
\pard{}{\f1{}--keep-going}\par
\pard\li720{}{K{\footnote K {\f1{}--keep-going}}}Continue as much as possible after an error.  While the target that failed, and those that depend on it, cannot be remade, the other prerequisites of these targets can be processed all the same.  See {\uldb Testing the Compilation of a Program}{\v Testing}.\par
\par
\pard{}{\f1{}-l [{\i load}]}\par
\pard\li720{}{K{\footnote K {\f1{}-l}}}\par
\par
\pard{}{\f1{}--load-average[={\i load}]}\par
\pard\li720{}{K{\footnote K {\f1{}--load-average}}}\par
\par
\pard{}{\f1{}--max-load[={\i load}]}\par
\pard\li720{}{K{\footnote K {\f1{}--max-load}}}Specifies that no new jobs (commands) should be started if there are other jobs running and the load average is at least {\i load} (a floating-point number).  With no argument, removes a previous load limit.  See {\uldb Parallel Execution}{\v Parallel}.\par
\par
\pard{}{\f1{}-n}\par
\pard\li720{}{K{\footnote K {\f1{}-n}}}\par
\par
\pard{}{\f1{}--just-print}\par
\pard\li720{}{K{\footnote K {\f1{}--just-print}}}\par
\par
\pard{}{\f1{}--dry-run}\par
\pard\li720{}{K{\footnote K {\f1{}--dry-run}}}\par
\par
\pard{}{\f1{}--recon}\par
\pard\li720{}{K{\footnote K {\f1{}--recon}}} Print the commands that would be executed, but do not execute them.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\par
\pard{}{\f1{}-o {\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}-o}}}\par
\par
\pard{}{\f1{}--old-file={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--old-file}}}\par
\par
\pard{}{\f1{}--assume-old={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--assume-old}}}Do not remake the file {\i file} even if it is older than its prerequisites, and do not remake anything on account of changes in {\i file}.  Essentially the file is treated as very old and its rules are ignored.  See {\uldb Avoiding Recompilation of Some Files}{\v Avoiding_Compilation}.\par
\par
\pard{}{\f1{}-p}\par
\pard\li720{}{K{\footnote K {\f1{}-p}}}\par
\par
\pard{}{\f1{}--print-data-base}\par
\pard\li720{}{K{\footnote K {\f1{}--print-data-base}}}Print the data base (rules and variable values) that results from reading the makefiles; then execute as usual or as otherwise specified.  This also prints the version information given by the {\f1{}-v} switch (see below).  To print the data base without trying to remake any files, use {\f1{}make -qp}.  To print the data base of predefined rules and variables, use {\f1{}make -p -f /dev/null}.\par
\par
\pard{}{\f1{}-q}\par
\pard\li720{}{K{\footnote K {\f1{}-q}}}\par
\par
\pard{}{\f1{}--question}\par
\pard\li720{}{K{\footnote K {\f1{}--question}}}"Question mode".  Do not run any commands, or print anything; just return an exit status that is zero if the specified targets are already up to date, one if any remaking is required, or two if an error is encountered.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\par
\pard{}{\f1{}-r}\par
\pard\li720{}{K{\footnote K {\f1{}-r}}}\par
\par
\pard{}{\f1{}--no-builtin-rules}\par
\pard\li720{}{K{\footnote K {\f1{}--no-builtin-rules}}}Eliminate use of the built-in implicit rules (see {\uldb Using Implicit Rules}{\v Implicit_Rules}).  You can still define your own by writing pattern rules (see {\uldb Defining and Redefining Pattern Rules}{\v Pattern_Rules}).  The {\f1{}-r} option also clears out the default list of suffixes for suffix rules (see {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}).  But you can still define your own suffixes with a rule for {\f1{}.SUFFIXES}, and then define your own suffix rules.  Note that only {\i rules} are affected by the {\f1{}-r} option; default variables remain in effect (see {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}); see the {\f1{}-R} option below.\par
\par
\pard{}{\f1{}-R}\par
\pard\li720{}{K{\footnote K {\f1{}-R}}}\par
\par
\pard{}{\f1{}--no-builtin-variables}\par
\pard\li720{}{K{\footnote K {\f1{}--no-builtin-variables}}}Eliminate use of the built-in rule-specific variables (see {\uldb Variables Used by Implicit Rules}{\v Implicit_Variables}).  You can still define your own, of course.  The {\f1{}-R} option also automatically enables the {\f1{}-r} option (see above), since it doesn't make sense to have implicit rules without any definitions for the variables that they use.\par
\par
\pard{}{\f1{}-s}\par
\pard\li720{}{K{\footnote K {\f1{}-s}}}\par
\par
\pard{}{\f1{}--silent}\par
\pard\li720{}{K{\footnote K {\f1{}--silent}}}\par
\par
\pard{}{\f1{}--quiet}\par
\pard\li720{}{K{\footnote K {\f1{}--quiet}}} Silent operation; do not print the commands as they are executed.  See {\uldb Command Echoing}{\v Echoing}.\par
\par
\pard{}{\f1{}-S}\par
\pard\li720{}{K{\footnote K {\f1{}-S}}}\par
\par
\pard{}{\f1{}--no-keep-going}\par
\pard\li720{}{K{\footnote K {\f1{}--no-keep-going}}}\par
\par
\pard{}{\f1{}--stop}\par
\pard\li720{}{K{\footnote K {\f1{}--stop}}} Cancel the effect of the {\f1{}-k} option.  This is never necessary except in a recursive {\f1{}make} where {\f1{}-k} might be inherited from the top-level {\f1{}make} via {\f1{}MAKEFLAGS} (see {\uldb Recursive Use of {\f1{}make}}{\v Recursion}) or if you set {\f1{}-k} in {\f1{}MAKEFLAGS} in your environment.\par
\par
\pard{}{\f1{}-t}\par
\pard\li720{}{K{\footnote K {\f1{}-t}}}\par
\par
\pard{}{\f1{}--touch}\par
\pard\li720{}{K{\footnote K {\f1{}--touch}}} Touch files (mark them up to date without really changing them) instead of running their commands.  This is used to pretend that the commands were done, in order to fool future invocations of {\f1{}make}.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\par
\pard{}{\f1{}-v}\par
\pard\li720{}{K{\footnote K {\f1{}-v}}}\par
\par
\pard{}{\f1{}--version}\par
\pard\li720{}{K{\footnote K {\f1{}--version}}}Print the version of the {\f1{}make} program plus a copyright, a list of authors, and a notice that there is no warranty; then exit.\par
\par
\pard{}{\f1{}-w}\par
\pard\li720{}{K{\footnote K {\f1{}-w}}}\par
\par
\pard{}{\f1{}--print-directory}\par
\pard\li720{}{K{\footnote K {\f1{}--print-directory}}}Print a message containing the working directory both before and after executing the makefile.  This may be useful for tracking down errors from complicated nests of recursive {\f1{}make} commands.  See {\uldb Recursive Use of {\f1{}make}}{\v Recursion}.  (In practice, you rarely need to specify this option since {\f1{}make} does it for you; see {\uldb The {\f1{}--print-directory} Option}{\v _w_Option}.)\par
\par
\pard{}{\f1{}--no-print-directory}\par
\pard\li720{}{K{\footnote K {\f1{}--no-print-directory}}}Disable printing of the working directory under {\f1{}-w}.  This option is useful when {\f1{}-w} is turned on automatically, but you do not want to see the extra messages.  See {\uldb The {\f1{}--print-directory} Option}{\v _w_Option}.\par
\par
\pard{}{\f1{}-W {\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}-W}}}\par
\par
\pard{}{\f1{}--what-if={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--what-if}}}\par
\par
\pard{}{\f1{}--new-file={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--new-file}}}\par
\par
\pard{}{\f1{}--assume-new={\i file}}\par
\pard\li720{}{K{\footnote K {\f1{}--assume-new}}}Pretend that the target {\i file} has just been modified.  When used with the {\f1{}-n} flag, this shows you what would happen if you were to modify that file.  Without {\f1{}-n}, it is almost the same as running a {\f1{}touch} command on the given file before running {\f1{}make}, except that the modification time is changed only in the imagination of {\f1{}make}.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\par
\pard{}{\f1{}--warn-undefined-variables}\par
\pard\li720{}{K{\footnote K {\f1{}--warn-undefined-variables}}}{K{\footnote K variables, warning for undefined}}{K{\footnote K undefined variables, warning message}}Issue a warning message whenever {\f1{}make} sees a reference to an undefined variable.  This can be helpful when you are trying to debug makefiles which use variables in complex ways.\par
\pard{}}\par
\page\pard Node: {\b Implicit Rules}, \keepn Next: {\uldb Archives}{\v Archives}, Prev: {\uldb Running}{\v Running}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Implicit Rules}
#{\footnote Implicit_Rules}
${\footnote \pard{}Using Implicit Rules}\par
\pard{\fs24\b Using Implicit Rules}\par
\par
\pard{}{K{\footnote K implicit rule}}{K{\footnote K rule, implicit}} Certain standard ways of remaking target files are used very often.  For example, one customary way to make an object file is from a C source file using the C compiler, {\f1{}cc}.\par
\par
\pard{}\'A2Implicit rules\'A2 tell {\f1{}make} how to use customary techniques so that you do not have to specify them in detail when you want to use them.  For example, there is an implicit rule for C compilation.  File names determine which implicit rules are run.  For example, C compilation typically takes a {\f1{}.c} file and makes a {\f1{}.o} file.  So {\f1{}make} applies the implicit rule for C compilation when it sees this combination of file name endings.\par
\par
\pard{}A chain of implicit rules can apply in sequence; for example, {\f1{}make} will remake a {\f1{}.o} file from a {\f1{}.y} file by way of a {\f1{}.c} file.\par
\par
\pard{}The built-in implicit rules use several variables in their commands so that, by changing the values of the variables, you can change the way the implicit rule works.  For example, the variable {\f1{}CFLAGS} controls the flags given to the C compiler by the implicit rule for C compilation.\par
\par
\pard{}You can define your own implicit rules by writing \'A2pattern rules\'A2.\par
\par
\pard{}\'A2Suffix rules\'A2 are a more limited way to define implicit rules.  Pattern rules are more general and clearer, but suffix rules are retained for compatibility.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Using Implicit}{\v Using_Implicit}\tab How to use an existing implicit rule to get the commands for updating a file.\par
{\uldb Catalogue of Rules}{\v Catalogue_of_Rules}\tab A list of built-in implicit rules.\par
{\uldb Implicit Variables}{\v Implicit_Variables}\tab How to change what predefined rules do.\par
{\uldb Chained Rules}{\v Chained_Rules}\tab How to use a chain of implicit rules.\par
{\uldb Pattern Rules}{\v Pattern_Rules}\tab How to define new implicit rules.\par
{\uldb Last Resort}{\v Last_Resort}\tab How to defining commands for rules which cannot find any.\par
{\uldb Suffix Rules}{\v Suffix_Rules}\tab The old-fashioned style of implicit rule.\par
{\uldb Implicit Rule Search}{\v Implicit_Rule_Search}\tab The precise algorithm for applying implicit rules.\par
\pard{}}\par
\page\pard Node: {\b Using Implicit}, \keepn Next: {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}, Prev: {\uldb }{\v }, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Using Implicit}
#{\footnote Using_Implicit}
${\footnote \pard{}Using Implicit Rules}\par
\pard{\fs24\b Using Implicit Rules}\par
\par
\pard{}{K{\footnote K implicit rule, how to use}}{K{\footnote K rule, implicit, how to use}} To allow {\f1{}make} to find a customary method for updating a target file, all you have to do is refrain from specifying commands yourself.  Either write a rule with no command lines, or don't write a rule at all.  Then {\f1{}make} will figure out which implicit rule to use based on which kind of source file exists or can be made.\par
\par
\pard{}For example, suppose the makefile looks like this:\par
\par
{\pard\keep\li720\f1{}foo : foo.o bar.o\line
        cc -o foo foo.o bar.o $(CFLAGS) $(LDFLAGS)\par
\pard\f0{}}\par
\pard{}Because you mention {\f1{}foo.o} but do not give a rule for it, {\f1{}make} will automatically look for an implicit rule that tells how to update it.  This happens whether or not the file {\f1{}foo.o} currently exists.\par
\par
\pard{}If an implicit rule is found, it can supply both commands and one or more prerequisites (the source files).  You would want to write a rule for {\f1{}foo.o} with no command lines if you need to specify additional prerequisites, such as header files, that the implicit rule cannot supply.\par
\par
\pard{}Each implicit rule has a target pattern and prerequisite patterns.  There may be many implicit rules with the same target pattern.  For example, numerous rules make {\f1{}.o} files: one, from a {\f1{}.c} file with the C compiler; another, from a {\f1{}.p} file with the Pascal compiler; and so on.  The rule that actually applies is the one whose prerequisites exist or can be made.  So, if you have a file {\f1{}foo.c}, {\f1{}make} will run the C compiler; otherwise, if you have a file {\f1{}foo.p}, {\f1{}make} will run the Pascal compiler; and so on.\par
\par
\pard{}Of course, when you write the makefile, you know which implicit rule you want {\f1{}make} to use, and you know it will choose that one because you know which possible prerequisite files are supposed to exist.  See {\uldb Catalogue of Implicit Rules}{\v Catalogue_of_Rules}, for a catalogue of all the predefined implicit rules.\par
\par
\pard{}Above, we said an implicit rule applies if the required prerequisites "exist or can be made".  A file "can be made" if it is mentioned explicitly in the makefile as a target or a prerequisite, or if an implicit rule can be recursively found for how to make it.  When an implicit prerequisite is the result of another implicit rule, we say that \'A2chaining\'A2 is occurring.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
\pard{}In general, {\f1{}make} searches for an implicit rule for each target, and for each double-colon rule, that has no commands.  A file that is mentioned only as a prerequisite is considered a target whose rule specifies nothing, so implicit rule search happens for it.  See {\uldb Implicit Rule Search Algorithm}{\v Implicit_Rule_Search}, for the details of how the search is done.\par
\par
\pard{}Note that explicit prerequisites do not influence implicit rule search.  For example, consider this explicit rule:\par
\par
{\pard\keep\li720\f1{}foo.o: foo.p\par
\pard\f0{}}\par
\pard{}The prerequisite on {\f1{}foo.p} does not necessarily mean that {\f1{}make} will remake {\f1{}foo.o} according to the implicit rule to make an object file, a {\f1{}.o} file, from a Pascal source file, a {\f1{}.p} file.  For example, if {\f1{}foo.c} also exists, the implicit rule to make an object file from a C source file is used instead, because it appears before the Pascal rule in the list of predefined implicit rules (see {\uldb Catalogue of Implicit Rules}{\v Catalogue_of_Rules}).\par
\par
\pard{}If you do not want an implicit rule to be used for a target that has no commands, you can give that target empty commands by writing a semicolon (see {\uldb Defining Empty Commands}{\v Empty_Commands}).\par
\par
\page\pard Node: {\b Catalogue of Rules}, \keepn Next: {\uldb Implicit Variables}{\v Implicit_Variables}, Prev: {\uldb Using Implicit}{\v Using_Implicit}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Catalogue of Rules}
#{\footnote Catalogue_of_Rules}
${\footnote \pard{}Catalogue of Implicit Rules}\par
\pard{\fs24\b Catalogue of Implicit Rules}\par
\par
\pard{}{K{\footnote K implicit rule, predefined}}{K{\footnote K rule, implicit, predefined}} Here is a catalogue of predefined implicit rules which are always available unless the makefile explicitly overrides or cancels them.  See {\uldb Canceling Implicit Rules}{\v Canceling_Rules}, for information on canceling or overriding an implicit rule.  The {\f1{}-r} or {\f1{}--no-builtin-rules} option cancels all predefined rules.\par
\par
\pard{}Not all of these rules will always be defined, even when the {\f1{}-r} option is not given.  Many of the predefined implicit rules are implemented in {\f1{}make} as suffix rules, so which ones will be defined depends on the \'A2suffix list\'A2 (the list of prerequisites of the special target {\f1{}.SUFFIXES}).  The default suffix list is: {\f1{}.out}, {\f1{}.a}, {\f1{}.ln}, {\f1{}.o}, {\f1{}.c}, {\f1{}.cc}, {\f1{}.C}, {\f1{}.p}, {\f1{}.f}, {\f1{}.F}, {\f1{}.r}, {\f1{}.y}, {\f1{}.l}, {\f1{}.s}, {\f1{}.S}, {\f1{}.mod}, {\f1{}.sym}, {\f1{}.def}, {\f1{}.h}, {\f1{}.info}, {\f1{}.dvi}, {\f1{}.tex}, {\f1{}.texinfo}, {\f1{}.texi}, {\f1{}.txinfo}, {\f1{}.w}, {\f1{}.ch} {\f1{}.web}, {\f1{}.sh}, {\f1{}.elc}, {\f1{}.el}.  All of the implicit rules described below whose prerequisites have one of these suffixes are actually suffix rules.  If you modify the suffix list, the only predefined suffix rules in effect will be those named by one or two of the suffixes that are on the list you specify; rules whose suffixes fail to be on the list are disabled.  See {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}, for full details on suffix rules.\par
\par
{\pard{}Compiling C programs\par
\pard\li720{}{K{\footnote K C, rule to compile}}{K{\footnote K cc}}{K{\footnote K gcc}}{K{\footnote K .o}}{K{\footnote K .c}}{\f1{}{\i n}.o} is made automatically from {\f1{}{\i n}.c} with a command of the form {\f1{}$(CC) -c $(CPPFLAGS) $(CFLAGS)}.\par
\par
\pard{}Compiling C++ programs\par
\pard\li720{}{K{\footnote K C++, rule to compile}}{K{\footnote K g++}}{K{\footnote K .C}}{K{\footnote K .cc}}{\f1{}{\i n}.o} is made automatically from {\f1{}{\i n}.cc} or {\f1{}{\i n}.C} with a command of the form {\f1{}$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)}.  We encourage you to use the suffix {\f1{}.cc} for C++ source files instead of {\f1{}.C}.\par
\par
\pard{}Compiling Pascal programs\par
\pard\li720{}{K{\footnote K Pascal, rule to compile}}{K{\footnote K pc}}{K{\footnote K .p}}{\f1{}{\i n}.o} is made automatically from {\f1{}{\i n}.p} with the command {\f1{}$(PC) -c $(PFLAGS)}.\par
\par
\pard{}Compiling Fortran and Ratfor programs\par
\pard\li720{}{K{\footnote K Fortran, rule to compile}}{K{\footnote K Ratfor, rule to compile}}{K{\footnote K f77}}{K{\footnote K .f}}{K{\footnote K .r}}{K{\footnote K .F}}{\f1{}{\i n}.o} is made automatically from {\f1{}{\i n}.r}, {\f1{}{\i n}.F} or {\f1{}{\i n}.f} by running the Fortran compiler.  The precise command used is as follows:\par
\par
{\pard\li720{}{\f1{}.f}\par
{\f1{}\pard\li1440{}$(FC) -c $(FFLAGS)}.\par
\par
\pard\li720{}{\f1{}.F}\par
{\f1{}\pard\li1440{}$(FC) -c $(FFLAGS) $(CPPFLAGS)}.\par
\par
\pard\li720{}{\f1{}.r}\par
{\f1{}\pard\li1440{}$(FC) -c $(FFLAGS) $(RFLAGS)}.\par
\pard\li720{}}\par
\pard{}Preprocessing Fortran and Ratfor programs\par
{\f1{}{\i \pard\li720{}n}.f} is made automatically from {\f1{}{\i n}.r} or {\f1{}{\i n}.F}.  This rule runs just the preprocessor to convert a Ratfor or preprocessable Fortran program into a strict Fortran program.  The precise command used is as follows:\par
\par
{\pard\li720{}{\f1{}.F}\par
{\f1{}\pard\li1440{}$(FC) -F $(CPPFLAGS) $(FFLAGS)}.\par
\par
\pard\li720{}{\f1{}.r}\par
{\f1{}\pard\li1440{}$(FC) -F $(FFLAGS) $(RFLAGS)}.\par
\pard\li720{}}\par
\pard{}Compiling Modula-2 programs\par
\pard\li720{}{K{\footnote K Modula-2, rule to compile}}{K{\footnote K m2c}}{K{\footnote K .sym}}{K{\footnote K .def}}{K{\footnote K .mod}}{\f1{}{\i n}.sym} is made from {\f1{}{\i n}.def} with a command of the form {\f1{}$(M2C) $(M2FLAGS) $(DEFFLAGS)}.  {\f1{}{\i n}.o} is made from {\f1{}{\i n}.mod}; the form is: {\f1{}$(M2C) $(M2FLAGS) $(MODFLAGS)}.\par
\par
\pard{}Assembling and preprocessing assembler programs\par
\pard\li720{}{K{\footnote K assembly, rule to compile}}{K{\footnote K as}}{K{\footnote K .s}}{\f1{}{\i n}.o} is made automatically from {\f1{}{\i n}.s} by running the assembler, {\f1{}as}.  The precise command is {\f1{}$(AS) $(ASFLAGS)}.\par
\par
\pard\li720{}{K{\footnote K .S}}{\f1{}{\i n}.s} is made automatically from {\f1{}{\i n}.S} by running the C preprocessor, {\f1{}cpp}.  The precise command is {\f1{}$(CPP) $(CPPFLAGS)}.\par
\par
\pard{}Linking a single object file\par
\pard\li720{}{K{\footnote K linking, predefined rule for}}{K{\footnote K ld}}{K{\footnote K .o}}{\f1{}{\i n}} is made automatically from {\f1{}{\i n}.o} by running the linker (usually called {\f1{}ld}) via the C compiler.  The precise command used is {\f1{}$(CC) $(LDFLAGS) {\i n}.o $(LOADLIBES) $(LDLIBS)}.\par
\par
\pard\li720{}This rule does the right thing for a simple program with only one source file.  It will also do the right thing if there are multiple object files (presumably coming from various other source files), one of which has a name matching that of the executable file.  Thus,\par
\par
{\pard\keep\li1440\f1{}x: y.o z.o\par
\pard\li720\f0{}}\par
\pard\li720{}when {\f1{}x.c}, {\f1{}y.c} and {\f1{}z.c} all exist will execute:\par
\par
{{\pard\keep\li1440\f1{}cc -c x.c -o x.o\line
cc -c y.c -o y.o\line
cc -c z.c -o z.o\line
cc x.o y.o z.o -o x\line
rm -f x.o\line
rm -f y.o\line
rm -f z.o\par
\pard\keep\li1440{}}}\par
\pard\li720\f0{}In more complicated cases, such as when there is no object file whose name derives from the executable file name, you must write an explicit command for linking.\par
\par
\pard\li720{}Each kind of file automatically made into {\f1{}.o} object files will be automatically linked by using the compiler ({\f1{}$(CC)}, {\f1{}$(FC)} or {\f1{}$(PC)}; the C compiler {\f1{}$(CC)} is used to assemble {\f1{}.s} files) without the {\f1{}-c} option.  This could be done by using the {\f1{}.o} object files as intermediates, but it is faster to do the compiling and linking in one step, so that's how it's done.\par
\par
\pard{}Yacc for C programs\par
\pard\li720{}{K{\footnote K yacc}}{K{\footnote K Yacc, rule to run}}{K{\footnote K .y}}{\f1{}{\i n}.c} is made automatically from {\f1{}{\i n}.y} by running Yacc with the command {\f1{}$(YACC) $(YFLAGS)}.\par
\par
\pard{}Lex for C programs\par
\pard\li720{}{K{\footnote K lex}}{K{\footnote K Lex, rule to run}}{K{\footnote K .l}}{\f1{}{\i n}.c} is made automatically from {\f1{}{\i n}.l} by by running Lex.  The actual command is {\f1{}$(LEX) $(LFLAGS)}.\par
\par
\pard{}Lex for Ratfor programs\par
{\f1{}{\i \pard\li720{}n}.r} is made automatically from {\f1{}{\i n}.l} by by running Lex.  The actual command is {\f1{}$(LEX) $(LFLAGS)}.\par
\par
\pard\li720{}The convention of using the same suffix {\f1{}.l} for all Lex files regardless of whether they produce C code or Ratfor code makes it impossible for {\f1{}make} to determine automatically which of the two languages you are using in any particular case.  If {\f1{}make} is called upon to remake an object file from a {\f1{}.l} file, it must guess which compiler to use.  It will guess the C compiler, because that is more common.  If you are using Ratfor, make sure {\f1{}make} knows this by mentioning {\f1{}{\i n}.r} in the makefile.  Or, if you are using Ratfor exclusively, with no C files, remove {\f1{}.c} from the list of implicit rule suffixes with:\par
\par
{{\pard\keep\li1440\f1{}.SUFFIXES:\line
.SUFFIXES: .o .r .f .l ...\par
\pard\keep\li1440{}}}\par
\pard\f0{}Making Lint Libraries from C, Yacc, or Lex programs\par
\pard\li720{}{K{\footnote K lint}}{K{\footnote K {\f1{}lint}, rule to run}}{K{\footnote K .ln}}{\f1{}{\i n}.ln} is made from {\f1{}{\i n}.c} by running {\f1{}lint}.  The precise command is {\f1{}$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i}.  The same command is used on the C code produced from {\f1{}{\i n}.y} or {\f1{}{\i n}.l}.\par
\par
\pard{}TeX and Web\par
\pard\li720{}{K{\footnote K TeX, rule to run}}{K{\footnote K Web, rule to run}}{K{\footnote K tex}}{K{\footnote K cweave}}{K{\footnote K weave}}{K{\footnote K tangle}}{K{\footnote K ctangle}}{K{\footnote K .dvi}}{K{\footnote K .tex}}{K{\footnote K .web}}{K{\footnote K .w}}{K{\footnote K .ch}}{\f1{}{\i n}.dvi} is made from {\f1{}{\i n}.tex} with the command {\f1{}$(TEX)}.  {\f1{}{\i n}.tex} is made from {\f1{}{\i n}.web} with {\f1{}$(WEAVE)}, or from {\f1{}{\i n}.w} (and from {\f1{}{\i n}.ch} if it exists or can be made) with {\f1{}$(CWEAVE)}.  {\f1{}{\i n}.p} is made from {\f1{}{\i n}.web} with {\f1{}$(TANGLE)} and {\f1{}{\i n}.c} is made from {\f1{}{\i n}.w} (and from {\f1{}{\i n}.ch} if it exists or can be made) with {\f1{}$(CTANGLE)}.\par
\par
\pard{}Texinfo and Info\par
\pard\li720{}{K{\footnote K Texinfo, rule to format}}{K{\footnote K Info, rule to format}}{K{\footnote K texi2dvi}}{K{\footnote K makeinfo}}{K{\footnote K .texinfo}}{K{\footnote K .info}}{K{\footnote K .texi}}{K{\footnote K .txinfo}}{\f1{}{\i n}.dvi} is made from {\f1{}{\i n}.texinfo}, {\f1{}{\i n}.texi}, or {\f1{}{\i n}.txinfo}, with the command {\f1{}$(TEXI2DVI) $(TEXI2DVI_FLAGS)}.  {\f1{}{\i n}.info} is made from {\f1{}{\i n}.texinfo}, {\f1{}{\i n}.texi}, or {\f1{}{\i n}.txinfo}, with the command {\f1{}$(MAKEINFO) $(MAKEINFO_FLAGS)}.\par
\par
\pard{}RCS\par
\pard\li720{}{K{\footnote K RCS, rule to extract from}}{K{\footnote K co}}{K{\footnote K ,v (RCS file extension)}}Any file {\f1{}{\i n}} is extracted if necessary from an RCS file named either {\f1{}{\i n},v} or {\f1{}RCS/{\i n},v}.  The precise command used is {\f1{}$(CO) $(COFLAGS)}.  {\f1{}{\i n}} will not be extracted from RCS if it already exists, even if the RCS file is newer.  The rules for RCS are terminal (see {\uldb Match-Anything Pattern Rules}{\v Match_Anything_Rules}), so RCS files cannot be generated from another source; they must actually exist.\par
\par
\pard{}SCCS\par
\pard\li720{}{K{\footnote K SCCS, rule to extract from}}{K{\footnote K get}}{K{\footnote K s. (SCCS file prefix)}}Any file {\f1{}{\i n}} is extracted if necessary from an SCCS file named either {\f1{}s.{\i n}} or {\f1{}SCCS/s.{\i n}}.  The precise command used is {\f1{}$(GET) $(GFLAGS)}.  The rules for SCCS are terminal (see {\uldb Match-Anything Pattern Rules}{\v Match_Anything_Rules}), so SCCS files cannot be generated from another source; they must actually exist.\par
\par
\pard\li720{}{K{\footnote K .sh}}For the benefit of SCCS, a file {\f1{}{\i n}} is copied from {\f1{}{\i n}.sh} and made executable (by everyone).  This is for shell scripts that are checked into SCCS.  Since RCS preserves the execution permission of a file, you do not need to use this feature with RCS.\par
\par
\pard\li720{}We recommend that you avoid using of SCCS.  RCS is widely held to be superior, and is also free.  By choosing free software in place of comparable (or inferior) proprietary software, you support the free software movement.\par
\pard{}}\par
\pard{}Usually, you want to change only the variables listed in the table above, which are documented in the following section.\par
\par
\pard{}However, the commands in built-in implicit rules actually use variables such as {\f1{}COMPILE.c}, {\f1{}LINK.p}, and {\f1{}PREPROCESS.S}, whose values contain the commands listed above.\par
\par
{\f1{}\pard{}make} follows the convention that the rule to compile a {\f1{}.{\i x}} source file uses the variable {\f1{}COMPILE.{\i x}}.  Similarly, the rule to produce an executable from a {\f1{}.{\i x}} file uses {\f1{}LINK.{\i x}}; and the rule to preprocess a {\f1{}.{\i x}} file uses {\f1{}PREPROCESS.{\i x}}.\par
\par
\pard{}{K{\footnote K OUTPUT_OPTION}}Every rule that produces an object file uses the variable {\f1{}OUTPUT_OPTION}.  {\f1{}make} defines this variable either to contain {\f1{}-o $@}, or to be empty, depending on a compile-time option.  You need the {\f1{}-o} option to ensure that the output goes into the right file when the source file is in a different directory, as when using {\f1{}VPATH} (see {\uldb Directory Search}{\v Directory_Search}).  However, compilers on some systems do not accept a {\f1{}-o} switch for object files.  If you use such a system, and use {\f1{}VPATH}, some compilations will put their output in the wrong place.  A possible workaround for this problem is to give {\f1{}OUTPUT_OPTION} the value {\f1{}; mv $*.o $@}.\par
\par
\page\pard Node: {\b Implicit Variables}, \keepn Next: {\uldb Chained Rules}{\v Chained_Rules}, Prev: {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Implicit Variables}
#{\footnote Implicit_Variables}
${\footnote \pard{}Variables Used by Implicit Rules}\par
\pard{\fs24\b Variables Used by Implicit Rules}\par
\par
\pard{}{K{\footnote K flags for compilers}} The commands in built-in implicit rules make liberal use of certain predefined variables.  You can alter these variables in the makefile, with arguments to {\f1{}make}, or in the environment to alter how the implicit rules work without redefining the rules themselves.  You can cancel all variables used by implicit rules with the {\f1{}-R} or {\f1{}--no-builtin-variables} option.\par
\par
\pard{}For example, the command used to compile a C source file actually says {\f1{}$(CC) -c $(CFLAGS) $(CPPFLAGS)}.  The default values of the variables used are {\f1{}cc} and nothing, resulting in the command {\f1{}cc -c}.  By redefining {\f1{}CC} to {\f1{}ncc}, you could cause {\f1{}ncc} to be used for all C compilations performed by the implicit rule.  By redefining {\f1{}CFLAGS} to be {\f1{}-g}, you could pass the {\f1{}-g} option to each compilation.  {\i All} implicit rules that do C compilation use {\f1{}$(CC)} to get the program name for the compiler and {\i all} include {\f1{}$(CFLAGS)} among the arguments given to the compiler.\par
\par
\pard{}The variables used in implicit rules fall into two classes: those that are names of programs (like {\f1{}CC}) and those that contain arguments for the programs (like {\f1{}CFLAGS}).  (The "name of a program" may also contain some command arguments, but it must start with an actual executable program name.)  If a variable value contains more than one argument, separate them with spaces.\par
\par
\pard{}Here is a table of variables used as names of programs in built-in rules:\par
\par
{\pard{}{\f1{}AR}\par
\pard\li720{}{K{\footnote K AR}}Archive-maintaining program; default {\f1{}ar}.  {K{\footnote K ar}}\par
\par
\pard{}{\f1{}AS}\par
\pard\li720{}{K{\footnote K AS}}Program for doing assembly; default {\f1{}as}.  {K{\footnote K as}}\par
\par
\pard{}{\f1{}CC}\par
\pard\li720{}{K{\footnote K CC}}Program for compiling C programs; default {\f1{}cc}.  {K{\footnote K cc}}\par
\par
\pard{}{\f1{}CXX}\par
\pard\li720{}{K{\footnote K CXX}}Program for compiling C++ programs; default {\f1{}g++}.  {K{\footnote K g++}}\par
\par
\pard{}{\f1{}CO}\par
\pard\li720{}{K{\footnote K CO}}Program for extracting a file from RCS; default {\f1{}co}.  {K{\footnote K co}}\par
\par
\pard{}{\f1{}CPP}\par
\pard\li720{}{K{\footnote K CPP}}Program for running the C preprocessor, with results to standard output; default {\f1{}$(CC) -E}.\par
\par
\pard{}{\f1{}FC}\par
\pard\li720{}{K{\footnote K FC}}Program for compiling or preprocessing Fortran and Ratfor programs; default {\f1{}f77}.  {K{\footnote K f77}}\par
\par
\pard{}{\f1{}GET}\par
\pard\li720{}{K{\footnote K GET}}Program for extracting a file from SCCS; default {\f1{}get}.  {K{\footnote K get}}\par
\par
\pard{}{\f1{}LEX}\par
\pard\li720{}{K{\footnote K LEX}}Program to use to turn Lex grammars into C programs or Ratfor programs; default {\f1{}lex}.  {K{\footnote K lex}}\par
\par
\pard{}{\f1{}PC}\par
\pard\li720{}{K{\footnote K PC}}Program for compiling Pascal programs; default {\f1{}pc}.  {K{\footnote K pc}}\par
\par
\pard{}{\f1{}YACC}\par
\pard\li720{}{K{\footnote K YACC}}Program to use to turn Yacc grammars into C programs; default {\f1{}yacc}.  {K{\footnote K yacc}}\par
\par
\pard{}{\f1{}YACCR}\par
\pard\li720{}{K{\footnote K YACCR}}Program to use to turn Yacc grammars into Ratfor programs; default {\f1{}yacc -r}.\par
\par
\pard{}{\f1{}MAKEINFO}\par
\pard\li720{}{K{\footnote K MAKEINFO}}Program to convert a Texinfo source file into an Info file; default {\f1{}makeinfo}.  {K{\footnote K makeinfo}}\par
\par
\pard{}{\f1{}TEX}\par
\pard\li720{}{K{\footnote K TEX}}Program to make TeX {\scaps\fs16{}dvi} files from TeX source; default {\f1{}tex}.  {K{\footnote K tex}}\par
\par
\pard{}{\f1{}TEXI2DVI}\par
\pard\li720{}{K{\footnote K TEXI2DVI}}Program to make TeX {\scaps\fs16{}dvi} files from Texinfo source; default {\f1{}texi2dvi}.  {K{\footnote K texi2dvi}}\par
\par
\pard{}{\f1{}WEAVE}\par
\pard\li720{}{K{\footnote K WEAVE}}Program to translate Web into TeX; default {\f1{}weave}.  {K{\footnote K weave}}\par
\par
\pard{}{\f1{}CWEAVE}\par
\pard\li720{}{K{\footnote K CWEAVE}}Program to translate C Web into TeX; default {\f1{}cweave}.  {K{\footnote K cweave}}\par
\par
\pard{}{\f1{}TANGLE}\par
\pard\li720{}{K{\footnote K TANGLE}}Program to translate Web into Pascal; default {\f1{}tangle}.  {K{\footnote K tangle}}\par
\par
\pard{}{\f1{}CTANGLE}\par
\pard\li720{}{K{\footnote K CTANGLE}}Program to translate C Web into C; default {\f1{}ctangle}.  {K{\footnote K ctangle}}\par
\par
\pard{}{\f1{}RM}\par
\pard\li720{}{K{\footnote K RM}}Command to remove a file; default {\f1{}rm -f}.  {K{\footnote K rm}}\par
\pard{}}\par
\pard{}Here is a table of variables whose values are additional arguments for the programs above.  The default values for all of these is the empty string, unless otherwise noted.\par
\par
{\pard{}{\f1{}ARFLAGS}\par
\pard\li720{}{K{\footnote K ARFLAGS}}Flags to give the archive-maintaining program; default {\f1{}rv}.\par
\par
\pard{}{\f1{}ASFLAGS}\par
\pard\li720{}{K{\footnote K ASFLAGS}}Extra flags to give to the assembler (when explicitly invoked on a {\f1{}.s} or {\f1{}.S} file).\par
\par
\pard{}{\f1{}CFLAGS}\par
\pard\li720{}{K{\footnote K CFLAGS}}Extra flags to give to the C compiler.\par
\par
\pard{}{\f1{}CXXFLAGS}\par
\pard\li720{}{K{\footnote K CXXFLAGS}}Extra flags to give to the C++ compiler.\par
\par
\pard{}{\f1{}COFLAGS}\par
\pard\li720{}{K{\footnote K COFLAGS}}Extra flags to give to the RCS {\f1{}co} program.\par
\par
\pard{}{\f1{}CPPFLAGS}\par
\pard\li720{}{K{\footnote K CPPFLAGS}}Extra flags to give to the C preprocessor and programs that use it (the C and Fortran compilers).\par
\par
\pard{}{\f1{}FFLAGS}\par
\pard\li720{}{K{\footnote K FFLAGS}}Extra flags to give to the Fortran compiler.\par
\par
\pard{}{\f1{}GFLAGS}\par
\pard\li720{}{K{\footnote K GFLAGS}}Extra flags to give to the SCCS {\f1{}get} program.\par
\par
\pard{}{\f1{}LDFLAGS}\par
\pard\li720{}{K{\footnote K LDFLAGS}}Extra flags to give to compilers when they are supposed to invoke the linker, {\f1{}ld}.\par
\par
\pard{}{\f1{}LFLAGS}\par
\pard\li720{}{K{\footnote K LFLAGS}}Extra flags to give to Lex.\par
\par
\pard{}{\f1{}PFLAGS}\par
\pard\li720{}{K{\footnote K PFLAGS}}Extra flags to give to the Pascal compiler.\par
\par
\pard{}{\f1{}RFLAGS}\par
\pard\li720{}{K{\footnote K RFLAGS}}Extra flags to give to the Fortran compiler for Ratfor programs.\par
\par
\pard{}{\f1{}YFLAGS}\par
\pard\li720{}{K{\footnote K YFLAGS}}Extra flags to give to Yacc.\par
\pard{}}\par
\page\pard Node: {\b Chained Rules}, \keepn Next: {\uldb Pattern Rules}{\v Pattern_Rules}, Prev: {\uldb Implicit Variables}{\v Implicit_Variables}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Chained Rules}
#{\footnote Chained_Rules}
${\footnote \pard{}Chains of Implicit Rules}\par
\pard{\fs24\b Chains of Implicit Rules}\par
\par
\pard{}{K{\footnote K chains of rules}}{K{\footnote K rule, implicit, chains of}}Sometimes a file can be made by a sequence of implicit rules.  For example, a file {\f1{}{\i n}.o} could be made from {\f1{}{\i n}.y} by running first Yacc and then {\f1{}cc}.  Such a sequence is called a \'A2chain\'A2.\par
\par
\pard{}If the file {\f1{}{\i n}.c} exists, or is mentioned in the makefile, no special searching is required: {\f1{}make} finds that the object file can be made by C compilation from {\f1{}{\i n}.c}; later on, when considering how to make {\f1{}{\i n}.c}, the rule for running Yacc is used.  Ultimately both {\f1{}{\i n}.c} and {\f1{}{\i n}.o} are updated.\par
\par
\pard{}{K{\footnote K intermediate files}}{K{\footnote K files, intermediate}}However, even if {\f1{}{\i n}.c} does not exist and is not mentioned, {\f1{}make} knows how to envision it as the missing link between {\f1{}{\i n}.o} and {\f1{}{\i n}.y}!  In this case, {\f1{}{\i n}.c} is called an \'A2intermediate file\'A2.  Once {\f1{}make} has decided to use the intermediate file, it is entered in the data base as if it had been mentioned in the makefile, along with the implicit rule that says how to create it.\par
\par
\pard{}Intermediate files are remade using their rules just like all other files.  But intermediate files are treated differently in two ways.\par
\par
\pard{}The first difference is what happens if the intermediate file does not exist.  If an ordinary file {\i b} does not exist, and {\f1{}make} considers a target that depends on {\i b}, it invariably creates {\i b} and then updates the target from {\i b}.  But if {\i b} is an intermediate file, then {\f1{}make} can leave well enough alone.  It won't bother updating {\i b}, or the ultimate target, unless some prerequisite of {\i b} is newer than that target or there is some other reason to update that target.\par
\par
\pard{}The second difference is that if {\f1{}make} {\i does} create {\i b} in order to update something else, it deletes {\i b} later on after it is no longer needed.  Therefore, an intermediate file which did not exist before {\f1{}make} also does not exist after {\f1{}make}.  {\f1{}make} reports the deletion to you by printing a {\f1{}rm -f} command showing which file it is deleting.\par
\par
\pard{}Ordinarily, a file cannot be intermediate if it is mentioned in the makefile as a target or prerequisite.  However, you can explicitly mark a file as intermediate by listing it as a prerequisite of the special target {\f1{}.INTERMEDIATE}.  This takes effect even if the file is mentioned explicitly in some other way.\par
\par
\pard{}{K{\footnote K intermediate files, preserving}}{K{\footnote K preserving intermediate files}}{K{\footnote K secondary files}}You can prevent automatic deletion of an intermediate file by marking it as a \'A2secondary\'A2 file.  To do this, list it as a prerequisite of the special target {\f1{}.SECONDARY}.  When a file is secondary, {\f1{}make} will not create the file merely because it does not already exist, but {\f1{}make} does not automatically delete the file.  Marking a file as secondary also marks it as intermediate.\par
\par
\pard{}You can list the target pattern of an implicit rule (such as {\f1{}%.o}) as a prerequisite of the special target {\f1{}.PRECIOUS} to preserve intermediate files made by implicit rules whose target patterns match that file's name; see {\uldb Interrupts}{\v Interrupts}.  {K{\footnote K preserving with {\f1{}.PRECIOUS}}}{K{\footnote K {\f1{}.PRECIOUS} intermediate files}} A chain can involve more than two implicit rules.  For example, it is possible to make a file {\f1{}foo} from {\f1{}RCS/foo.y,v} by running RCS, Yacc and {\f1{}cc}.  Then both {\f1{}foo.y} and {\f1{}foo.c} are intermediate files that are deleted at the end.\par
\par
\pard{}No single implicit rule can appear more than once in a chain.  This means that {\f1{}make} will not even consider such a ridiculous thing as making {\f1{}foo} from {\f1{}foo.o.o} by running the linker twice.  This constraint has the added benefit of preventing any infinite loop in the search for an implicit rule chain.\par
\par
\pard{}There are some special implicit rules to optimize certain cases that would otherwise be handled by rule chains.  For example, making {\f1{}foo} from {\f1{}foo.c} could be handled by compiling and linking with separate chained rules, using {\f1{}foo.o} as an intermediate file.  But what actually happens is that a special rule for this case does the compilation and linking with a single {\f1{}cc} command.  The optimized rule is used in preference to the step-by-step chain because it comes earlier in the ordering of rules.\par
\par
\page\pard Node: {\b Pattern Rules}, \keepn Next: {\uldb Last Resort}{\v Last_Resort}, Prev: {\uldb Chained Rules}{\v Chained_Rules}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Pattern Rules}
#{\footnote Pattern_Rules}
${\footnote \pard{}Defining and Redefining Pattern Rules}\par
\pard{\fs24\b Defining and Redefining Pattern Rules}\par
\par
\pard{}You define an implicit rule by writing a \'A2pattern rule\'A2.  A pattern rule looks like an ordinary rule, except that its target contains the character {\f1{}%} (exactly one of them).  The target is considered a pattern for matching file names; the {\f1{}%} can match any nonempty substring, while other characters match only themselves.  The prerequisites likewise use {\f1{}%} to show how their names relate to the target name.\par
\par
\pard{}Thus, a pattern rule {\f1{}%.o : %.c} says how to make any file {\f1{}{\i stem}.o} from another file {\f1{}{\i stem}.c}.\par
\par
\pard{}Note that expansion using {\f1{}%} in pattern rules occurs {\b after} any variable or function expansions, which take place when the makefile is read.  See {\uldb How to Use Variables}{\v Using_Variables}, and {\uldb Functions for Transforming Text}{\v Functions}.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Pattern Intro}{\v Pattern_Intro}\tab An introduction to pattern rules.\par
{\uldb Pattern Examples}{\v Pattern_Examples}\tab Examples of pattern rules.\par
{\uldb Automatic}{\v Automatic}\tab How to use automatic variables in the commands of implicit rules.\par
{\uldb Pattern Match}{\v Pattern_Match}\tab How patterns match.\par
{\uldb Match-Anything Rules}{\v Match_Anything_Rules}\tab Precautions you should take prior to defining rules that can match any target file whatever.\par
{\uldb Canceling Rules}{\v Canceling_Rules}\tab How to override or cancel built-in rules.\par
\pard{}}\par
\page\pard Node: {\b Pattern Intro}, \keepn Next: {\uldb Pattern Examples}{\v Pattern_Examples}, Prev: {\uldb }{\v }, Up: {\uldb Pattern Rules}{\v Pattern_Rules}\line
K{\footnote K Pattern Intro}
#{\footnote Pattern_Intro}
${\footnote \pard{}Introduction to Pattern Rules}\par
\pard{\fs24\b Introduction to Pattern Rules}\par
\par
\pard{}{K{\footnote K pattern rule}}{K{\footnote K rule, pattern}} A pattern rule contains the character {\f1{}%} (exactly one of them) in the target; otherwise, it looks exactly like an ordinary rule.  The target is a pattern for matching file names; the {\f1{}%} matches any nonempty substring, while other characters match only themselves.  {K{\footnote K target pattern, implicit}}{K{\footnote K {\f1{}%}, in pattern rules}} For example, {\f1{}%.c} as a pattern matches any file name that ends in {\f1{}.c}.  {\f1{}s.%.c} as a pattern matches any file name that starts with {\f1{}s.}, ends in {\f1{}.c} and is at least five characters long.  (There must be at least one character to match the {\f1{}%}.)  The substring that the {\f1{}%} matches is called the \'A2stem\'A2.\par
\par
{\f1{}\pard{}%} in a prerequisite of a pattern rule stands for the same stem that was matched by the {\f1{}%} in the target.  In order for the pattern rule to apply, its target pattern must match the file name under consideration, and its prerequisite patterns must name files that exist or can be made.  These files become prerequisites of the target.  {K{\footnote K prerequisite pattern, implicit}} Thus, a rule of the form\par
\par
{\pard\keep\li720\f1{}%.o : %.c ; {\i command}...\par
\pard\f0{}}\par
\pard{}specifies how to make a file {\f1{}{\i n}.o}, with another file {\f1{}{\i n}.c} as its prerequisite, provided that {\f1{}{\i n}.c} exists or can be made.\par
\par
\pard{}There may also be prerequisites that do not use {\f1{}%}; such a prerequisite attaches to every file made by this pattern rule.  These unvarying prerequisites are useful occasionally.\par
\par
\pard{}A pattern rule need not have any prerequisites that contain {\f1{}%}, or in fact any prerequisites at all.  Such a rule is effectively a general wildcard.  It provides a way to make any file that matches the target pattern.  See {\uldb Last Resort}{\v Last_Resort}.\par
\par
\pard{}Pattern rules may have more than one target.  Unlike normal rules, this does not act as many different rules with the same prerequisites and commands.  If a pattern rule has multiple targets, {\f1{}make} knows that the rule's commands are responsible for making all of the targets.  The commands are executed only once to make all the targets.  When searching for a pattern rule to match a target, the target patterns of a rule other than the one that matches the target in need of a rule are incidental: {\f1{}make} worries only about giving commands and prerequisites to the file presently in question.  However, when this file's commands are run, the other targets are marked as having been updated themselves.  {K{\footnote K multiple targets, in pattern rule}}{K{\footnote K target, multiple in pattern rule}} The order in which pattern rules appear in the makefile is important since this is the order in which they are considered.  Of equally applicable rules, only the first one found is used.  The rules you write take precedence over those that are built in.  Note however, that a rule whose prerequisites actually exist or are mentioned always takes priority over a rule with prerequisites that must be made by chaining other implicit rules.  {K{\footnote K pattern rules, order of}}{K{\footnote K order of pattern rules}}\par
\par
\page\pard Node: {\b Pattern Examples}, \keepn Next: {\uldb Automatic}{\v Automatic}, Prev: {\uldb Pattern Intro}{\v Pattern_Intro}, Up: {\uldb Pattern Rules}{\v Pattern_Rules}\line
K{\footnote K Pattern Examples}
#{\footnote Pattern_Examples}
${\footnote \pard{}Pattern Rule Examples}\par
\pard{\fs24\b Pattern Rule Examples}\par
\par
\pard{}Here are some examples of pattern rules actually predefined in {\f1{}make}.  First, the rule that compiles {\f1{}.c} files into {\f1{}.o} files:\par
\par
{\pard\keep\li720\f1{}%.o : %.c\line
        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@\par
\pard\f0{}}\par
\pard{}defines a rule that can make any file {\f1{}{\i x}.o} from {\f1{}{\i x}.c}.  The command uses the automatic variables {\f1{}$@} and {\f1{}$<} to substitute the names of the target file and the source file in each case where the rule applies (see {\uldb Automatic Variables}{\v Automatic}).\par
\par
\pard{}Here is a second built-in rule:\par
\par
{\pard\keep\li720\f1{}% :: RCS/%,v\line
        $(CO) $(COFLAGS) $<\par
\pard\f0{}}\par
\pard{}defines a rule that can make any file {\f1{}{\i x}} whatsoever from a corresponding file {\f1{}{\i x},v} in the subdirectory {\f1{}RCS}.  Since the target is {\f1{}%}, this rule will apply to any file whatever, provided the appropriate prerequisite file exists.  The double colon makes the rule \'A2terminal\'A2, which means that its prerequisite may not be an intermediate file (see {\uldb Match-Anything Pattern Rules}{\v Match_Anything_Rules}).\par
\par
\pard{}This pattern rule has two targets:\par
\par
{{\pard\keep\li720\f1{}%.tab.c %.tab.h: %.y\line
        bison -d $<\par
\pard\keep\li720{}}}\par
\pard\f0{}This tells {\f1{}make} that the command {\f1{}bison -d {\i x}.y} will make both {\f1{}{\i x}.tab.c} and {\f1{}{\i x}.tab.h}.  If the file {\f1{}foo} depends on the files {\f1{}parse.tab.o} and {\f1{}scan.o} and the file {\f1{}scan.o} depends on the file {\f1{}parse.tab.h}, when {\f1{}parse.y} is changed, the command {\f1{}bison -d parse.y} will be executed only once, and the prerequisites of both {\f1{}parse.tab.o} and {\f1{}scan.o} will be satisfied.  (Presumably the file {\f1{}parse.tab.o} will be recompiled from {\f1{}parse.tab.c} and the file {\f1{}scan.o} from {\f1{}scan.c}, while {\f1{}foo} is linked from {\f1{}parse.tab.o}, {\f1{}scan.o}, and its other prerequisites, and it will execute happily ever after.)\par
\par
\page\pard Node: {\b Automatic}, \keepn Next: {\uldb Pattern Match}{\v Pattern_Match}, Prev: {\uldb Pattern Examples}{\v Pattern_Examples}, Up: {\uldb Pattern Rules}{\v Pattern_Rules}\line
K{\footnote K Automatic}
#{\footnote Automatic}
${\footnote \pard{}Automatic Variables}\par
\pard{\fs24\b Automatic Variables}\par
\par
\pard{}{K{\footnote K automatic variables}}{K{\footnote K variables, automatic}}{K{\footnote K variables, and implicit rule}} Suppose you are writing a pattern rule to compile a {\f1{}.c} file into a {\f1{}.o} file: how do you write the {\f1{}cc} command so that it operates on the right source file name?  You cannot write the name in the command, because the name is different each time the implicit rule is applied.\par
\par
\pard{}What you do is use a special feature of {\f1{}make}, the \'A2automatic variables\'A2.  These variables have values computed afresh for each rule that is executed, based on the target and prerequisites of the rule.  In this example, you would use {\f1{}$@} for the object file name and {\f1{}$<} for the source file name.\par
\par
\pard{}Here is a table of automatic variables:\par
\par
{\pard\li720{}{K{\footnote K $@}}{K{\footnote K @ (automatic variable)}}\par
\par
\pard{}{\f1{}$@}\par
\pard\li720{}The file name of the target of the rule.  If the target is an archive member, then {\f1{}$@} is the name of the archive file.  In a pattern rule that has multiple targets (see {\uldb Introduction to Pattern Rules}{\v Pattern_Intro}), {\f1{}$@} is the name of whichever target caused the rule's commands to be run.\par
\par
\pard\li720{}{K{\footnote K $%}}{K{\footnote K % (automatic variable)}}\par
\par
\pard{}{\f1{}$%}\par
\pard\li720{}The target member name, when the target is an archive member.  See {\uldb Archives}{\v Archives}.  For example, if the target is {\f1{}foo.a(bar.o)} then {\f1{}$%} is {\f1{}bar.o} and {\f1{}$@} is {\f1{}foo.a}.  {\f1{}$%} is empty when the target is not an archive member.\par
\par
\pard\li720{}{K{\footnote K $<}}{K{\footnote K < (automatic variable)}}\par
\par
\pard{}{\f1{}$<}\par
\pard\li720{}The name of the first prerequisite.  If the target got its commands from an implicit rule, this will be the first prerequisite added by the implicit rule (see {\uldb Implicit Rules}{\v Implicit_Rules}).\par
\par
\pard\li720{}{K{\footnote K $?}}{K{\footnote K ? (automatic variable)}}\par
\par
\pard{}{\f1{}$?}\par
\pard\li720{}The names of all the prerequisites that are newer than the target, with spaces between them.  For prerequisites which are archive members, only the member named is used (see {\uldb Archives}{\v Archives}).  {K{\footnote K prerequisites, list of changed}}{K{\footnote K list of changed prerequisites}} {K{\footnote K $^}}{K{\footnote K ^ (automatic variable)}}\par
\par
\pard{}{\f1{}$^}\par
\pard\li720{}The names of all the prerequisites, with spaces between them.  For prerequisites which are archive members, only the member named is used (see {\uldb Archives}{\v Archives}).  A target has only one prerequisite on each other file it depends on, no matter how many times each file is listed as a prerequisite.  So if you list a prerequisite more than once for a target, the value of {\f1{}$^} contains just one copy of the name.  {K{\footnote K prerequisites, list of all}}{K{\footnote K list of all prerequisites}} {K{\footnote K $+}}{K{\footnote K + (automatic variable)}}\par
\par
\pard{}{\f1{}$+}\par
\pard\li720{}This is like {\f1{}$^}, but prerequisites listed more than once are duplicated in the order they were listed in the makefile.  This is primarily useful for use in linking commands where it is meaningful to repeat library file names in a particular order.\par
\par
\pard\li720{}{K{\footnote K $*}}{K{\footnote K * (automatic variable)}}\par
\par
\pard{}{\f1{}$*}\par
\pard\li720{}The stem with which an implicit rule matches (see {\uldb How Patterns Match}{\v Pattern_Match}).  If the target is {\f1{}dir/a.foo.b} and the target pattern is {\f1{}a.%.b} then the stem is {\f1{}dir/foo}.  The stem is useful for constructing names of related files.  {K{\footnote K stem, variable for}} In a static pattern rule, the stem is part of the file name that matched the {\f1{}%} in the target pattern.\par
\par
\pard\li720{}In an explicit rule, there is no stem; so {\f1{}$*} cannot be determined in that way.  Instead, if the target name ends with a recognized suffix (see {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}), {\f1{}$*} is set to the target name minus the suffix.  For example, if the target name is {\f1{}foo.c}, then {\f1{}$*} is set to {\f1{}foo}, since {\f1{}.c} is a suffix.  GNU {\f1{}make} does this bizarre thing only for compatibility with other implementations of {\f1{}make}.  You should generally avoid using {\f1{}$*} except in implicit rules or static pattern rules.\par
\par
\pard\li720{}If the target name in an explicit rule does not end with a recognized suffix, {\f1{}$*} is set to the empty string for that rule.\par
\pard{}}\par
{\f1{}\pard{}$?} is useful even in explicit rules when you wish to operate on only the prerequisites that have changed.  For example, suppose that an archive named {\f1{}lib} is supposed to contain copies of several object files.  This rule copies just the changed object files into the archive:\par
\par
{{\pard\keep\li720\f1{}lib: foo.o bar.o lose.o win.o\line
        ar r lib $?\par
\pard\keep\li720{}}}\par
\pard\f0{}Of the variables listed above, four have values that are single file names, and three have values that are lists of file names.  These seven have variants that get just the file's directory name or just the file name within the directory.  The variant variables' names are formed by appending {\f1{}D} or {\f1{}F}, respectively.  These variants are semi-obsolete in GNU {\f1{}make} since the functions {\f1{}dir} and {\f1{}notdir} can be used to get a similar effect (see {\uldb Functions for File Names}{\v File_Name_Functions}).  Note, however, that the {\f1{}F} variants all omit the trailing slash which always appears in the output of the {\f1{}dir} function.  Here is a table of the variants:\par
\par
{\pard\li720{}{K{\footnote K $(@D)}}{K{\footnote K @D (automatic variable)}}\par
\par
\pard{}{\f1{}$(@D)}\par
\pard\li720{}The directory part of the file name of the target, with the trailing slash removed.  If the value of {\f1{}$@} is {\f1{}dir/foo.o} then {\f1{}$(@D)} is {\f1{}dir}.  This value is {\f1{}.} if {\f1{}$@} does not contain a slash.\par
\par
\pard\li720{}{K{\footnote K $(@F)}}{K{\footnote K @F (automatic variable)}}\par
\par
\pard{}{\f1{}$(@F)}\par
\pard\li720{}The file-within-directory part of the file name of the target.  If the value of {\f1{}$@} is {\f1{}dir/foo.o} then {\f1{}$(@F)} is {\f1{}foo.o}.  {\f1{}$(@F)} is equivalent to {\f1{}$(notdir $@)}.\par
\par
\pard\li720{}{K{\footnote K $(*D)}}{K{\footnote K *D (automatic variable)}}\par
\par
\pard{}{\f1{}$(*D)}\par
\pard\li720{}{K{\footnote K $(*F)}}{K{\footnote K *F (automatic variable)}}\par
\par
\pard{}{\f1{}$(*F)}\par
\pard\li720{}The directory part and the file-within-directory part of the stem; {\f1{}dir} and {\f1{}foo} in this example.\par
\par
\pard\li720{}{K{\footnote K $(%D)}}{K{\footnote K %D (automatic variable)}}\par
\par
\pard{}{\f1{}$(%D)}\par
\pard\li720{}{K{\footnote K $(%F)}}{K{\footnote K %F (automatic variable)}}\par
\par
\pard{}{\f1{}$(%F)}\par
\pard\li720{}The directory part and the file-within-directory part of the target archive member name.  This makes sense only for archive member targets of the form {\f1{}{\i archive}({\i member})} and is useful only when {\i member} may contain a directory name.  (See {\uldb Archive Members as Targets}{\v Archive_Members}.)\par
\par
\pard\li720{}{K{\footnote K $(<D)}}{K{\footnote K <D (automatic variable)}}\par
\par
\pard{}{\f1{}$(<D)}\par
\pard\li720{}{K{\footnote K $(<F)}}{K{\footnote K <F (automatic variable)}}\par
\par
\pard{}{\f1{}$(<F)}\par
\pard\li720{}The directory part and the file-within-directory part of the first prerequisite.\par
\par
\pard\li720{}{K{\footnote K $(^D)}}{K{\footnote K ^D (automatic variable)}}\par
\par
\pard{}{\f1{}$(^D)}\par
\pard\li720{}{K{\footnote K $(^F)}}{K{\footnote K ^F (automatic variable)}}\par
\par
\pard{}{\f1{}$(^F)}\par
\pard\li720{}Lists of the directory parts and the file-within-directory parts of all prerequisites.\par
\par
\pard\li720{}{K{\footnote K $(?D)}}{K{\footnote K ?D (automatic variable)}}\par
\par
\pard{}{\f1{}$(?D)}\par
\pard\li720{}{K{\footnote K $(?F)}}{K{\footnote K ?F (automatic variable)}}\par
\par
\pard{}{\f1{}$(?F)}\par
\pard\li720{}Lists of the directory parts and the file-within-directory parts of all prerequisites that are newer than the target.\par
\pard{}}\par
\pard{}Note that we use a special stylistic convention when we talk about these automatic variables; we write "the value of {\f1{}$<}", rather than "the variable {\f1{}<}" as we would write for ordinary variables such as {\f1{}objects} and {\f1{}CFLAGS}.  We think this convention looks more natural in this special case.  Please do not assume it has a deep significance; {\f1{}$<} refers to the variable named {\f1{}<} just as {\f1{}$(CFLAGS)} refers to the variable named {\f1{}CFLAGS}.  You could just as well use {\f1{}$(<)} in place of {\f1{}$<}.\par
\par
\page\pard Node: {\b Pattern Match}, \keepn Next: {\uldb Match-Anything Rules}{\v Match_Anything_Rules}, Prev: {\uldb Automatic}{\v Automatic}, Up: {\uldb Pattern Rules}{\v Pattern_Rules}\line
K{\footnote K Pattern Match}
#{\footnote Pattern_Match}
${\footnote \pard{}How Patterns Match}\par
\pard{\fs24\b How Patterns Match}\par
\par
\pard{}{K{\footnote K stem}}A target pattern is composed of a {\f1{}%} between a prefix and a suffix, either or both of which may be empty.  The pattern matches a file name only if the file name starts with the prefix and ends with the suffix, without overlap.  The text between the prefix and the suffix is called the \'A2stem\'A2.  Thus, when the pattern {\f1{}%.o} matches the file name {\f1{}test.o}, the stem is {\f1{}test}.  The pattern rule prerequisites are turned into actual file names by substituting the stem for the character {\f1{}%}.  Thus, if in the same example one of the prerequisites is written as {\f1{}%.c}, it expands to {\f1{}test.c}.\par
\par
\pard{}When the target pattern does not contain a slash (and it usually does not), directory names in the file names are removed from the file name before it is compared with the target prefix and suffix.  After the comparison of the file name to the target pattern, the directory names, along with the slash that ends them, are added on to the prerequisite file names generated from the pattern rule's prerequisite patterns and the file name. The directories are ignored only for the purpose of finding an implicit rule to use, not in the application of that rule.  Thus, {\f1{}e%t} matches the file name {\f1{}src/eat}, with {\f1{}src/a} as the stem.  When prerequisites are turned into file names, the directories from the stem are added at the front, while the rest of the stem is substituted for the {\f1{}%}.  The stem {\f1{}src/a} with a prerequisite pattern {\f1{}c%r} gives the file name {\f1{}src/car}.\par
\par
\page\pard Node: {\b Match-Anything Rules}, \keepn Next: {\uldb Canceling Rules}{\v Canceling_Rules}, Prev: {\uldb Pattern Match}{\v Pattern_Match}, Up: {\uldb Pattern Rules}{\v Pattern_Rules}\line
K{\footnote K Match-Anything Rules}
#{\footnote Match_Anything_Rules}
${\footnote \pard{}Match-Anything Pattern Rules}\par
\pard{\fs24\b Match-Anything Pattern Rules}\par
\par
\pard{}{K{\footnote K match-anything rule}}{K{\footnote K terminal rule}}When a pattern rule's target is just {\f1{}%}, it matches any file name whatever.  We call these rules \'A2match-anything\'A2 rules.  They are very useful, but it can take a lot of time for {\f1{}make} to think about them, because it must consider every such rule for each file name listed either as a target or as a prerequisite.\par
\par
\pard{}Suppose the makefile mentions {\f1{}foo.c}.  For this target, {\f1{}make} would have to consider making it by linking an object file {\f1{}foo.c.o}, or by C compilation-and-linking in one step from {\f1{}foo.c.c}, or by Pascal compilation-and-linking from {\f1{}foo.c.p}, and many other possibilities.\par
\par
\pard{}We know these possibilities are ridiculous since {\f1{}foo.c} is a C source file, not an executable.  If {\f1{}make} did consider these possibilities, it would ultimately reject them, because files such as {\f1{}foo.c.o} and {\f1{}foo.c.p} would not exist.  But these possibilities are so numerous that {\f1{}make} would run very slowly if it had to consider them.\par
\par
\pard{}To gain speed, we have put various constraints on the way {\f1{}make} considers match-anything rules.  There are two different constraints that can be applied, and each time you define a match-anything rule you must choose one or the other for that rule.\par
\par
\pard{}One choice is to mark the match-anything rule as \'A2terminal\'A2 by defining it with a double colon.  When a rule is terminal, it does not apply unless its prerequisites actually exist.  Prerequisites that could be made with other implicit rules are not good enough.  In other words, no further chaining is allowed beyond a terminal rule.\par
\par
\pard{}For example, the built-in implicit rules for extracting sources from RCS and SCCS files are terminal; as a result, if the file {\f1{}foo.c,v} does not exist, {\f1{}make} will not even consider trying to make it as an intermediate file from {\f1{}foo.c,v.o} or from {\f1{}RCS/SCCS/s.foo.c,v}.  RCS and SCCS files are generally ultimate source files, which should not be remade from any other files; therefore, {\f1{}make} can save time by not looking for ways to remake them.\par
\par
\pard{}If you do not mark the match-anything rule as terminal, then it is nonterminal.  A nonterminal match-anything rule cannot apply to a file name that indicates a specific type of data.  A file name indicates a specific type of data if some non-match-anything implicit rule target matches it.\par
\par
\pard{}For example, the file name {\f1{}foo.c} matches the target for the pattern rule {\f1{}%.c : %.y} (the rule to run Yacc).  Regardless of whether this rule is actually applicable (which happens only if there is a file {\f1{}foo.y}), the fact that its target matches is enough to prevent consideration of any nonterminal match-anything rules for the file {\f1{}foo.c}.  Thus, {\f1{}make} will not even consider trying to make {\f1{}foo.c} as an executable file from {\f1{}foo.c.o}, {\f1{}foo.c.c}, {\f1{}foo.c.p}, etc.\par
\par
\pard{}The motivation for this constraint is that nonterminal match-anything rules are used for making files containing specific types of data (such as executable files) and a file name with a recognized suffix indicates some other specific type of data (such as a C source file).\par
\par
\pard{}Special built-in dummy pattern rules are provided solely to recognize certain file names so that nonterminal match-anything rules will not be considered.  These dummy rules have no prerequisites and no commands, and they are ignored for all other purposes.  For example, the built-in implicit rule\par
\par
{\pard\keep\li720\f1{}%.p :\par
\pard\f0{}}\par
\pard{}exists to make sure that Pascal source files such as {\f1{}foo.p} match a specific target pattern and thereby prevent time from being wasted looking for {\f1{}foo.p.o} or {\f1{}foo.p.c}.\par
\par
\pard{}Dummy pattern rules such as the one for {\f1{}%.p} are made for every suffix listed as valid for use in suffix rules (see {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}).\par
\par
\page\pard Node: {\b Canceling Rules}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Match-Anything Rules}{\v Match_Anything_Rules}, Up: {\uldb Pattern Rules}{\v Pattern_Rules}\line
K{\footnote K Canceling Rules}
#{\footnote Canceling_Rules}
${\footnote \pard{}Canceling Implicit Rules}\par
\pard{\fs24\b Canceling Implicit Rules}\par
\par
\pard{}You can override a built-in implicit rule (or one you have defined yourself) by defining a new pattern rule with the same target and prerequisites, but different commands.  When the new rule is defined, the built-in one is replaced.  The new rule's position in the sequence of implicit rules is determined by where you write the new rule.\par
\par
\pard{}You can cancel a built-in implicit rule by defining a pattern rule with the same target and prerequisites, but no commands.  For example, the following would cancel the rule that runs the assembler:\par
\par
{\pard\keep\li720\f1{}%.o : %.s\par
\pard\f0{}}\par
\page\pard Node: {\b Last Resort}, \keepn Next: {\uldb Suffix Rules}{\v Suffix_Rules}, Prev: {\uldb Pattern Rules}{\v Pattern_Rules}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Last Resort}
#{\footnote Last_Resort}
${\footnote \pard{}Defining Last-Resort Default Rules}\par
\pard{\fs24\b Defining Last-Resort Default Rules}\par
\par
\pard{}{K{\footnote K last-resort default rules}}{K{\footnote K default rules, last-resort}} You can define a last-resort implicit rule by writing a terminal match-anything pattern rule with no prerequisites (see {\uldb Match-Anything Rules}{\v Match_Anything_Rules}).  This is just like any other pattern rule; the only thing special about it is that it will match any target.  So such a rule's commands are used for all targets and prerequisites that have no commands of their own and for which no other implicit rule applies.\par
\par
\pard{}For example, when testing a makefile, you might not care if the source files contain real data, only that they exist.  Then you might do this:\par
\par
{\pard\keep\li720\f1{}%::\line
        touch $@\par
\pard\f0{}}\par
\pard{}to cause all the source files needed (as prerequisites) to be created automatically.\par
\par
\pard{}{K{\footnote K .DEFAULT}}You can instead define commands to be used for targets for which there are no rules at all, even ones which don't specify commands.  You do this by writing a rule for the target {\f1{}.DEFAULT}.  Such a rule's commands are used for all prerequisites which do not appear as targets in any explicit rule, and for which no implicit rule applies.  Naturally, there is no {\f1{}.DEFAULT} rule unless you write one.\par
\par
\pard{}If you use {\f1{}.DEFAULT} with no commands or prerequisites:\par
\par
{\pard\keep\li720\f1{}.DEFAULT:\par
\pard\f0{}}\par
\pard{}the commands previously stored for {\f1{}.DEFAULT} are cleared.  Then {\f1{}make} acts as if you had never defined {\f1{}.DEFAULT} at all.\par
\par
\pard{}If you do not want a target to get the commands from a match-anything pattern rule or {\f1{}.DEFAULT}, but you also do not want any commands to be run for the target, you can give it empty commands (see {\uldb Defining Empty Commands}{\v Empty_Commands}).\par
\par
\pard{}You can use a last-resort rule to override part of another makefile.  See {\uldb Overriding Part of Another Makefile}{\v Overriding_Makefiles}.\par
\par
\page\pard Node: {\b Suffix Rules}, \keepn Next: {\uldb Implicit Rule Search}{\v Implicit_Rule_Search}, Prev: {\uldb Last Resort}{\v Last_Resort}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Suffix Rules}
#{\footnote Suffix_Rules}
${\footnote \pard{}Old-Fashioned Suffix Rules}\par
\pard{\fs24\b Old-Fashioned Suffix Rules}\par
\par
\pard{}{K{\footnote K old-fashioned suffix rules}}{K{\footnote K suffix rule}} \'A2Suffix rules\'A2 are the old-fashioned way of defining implicit rules for {\f1{}make}.  Suffix rules are obsolete because pattern rules are more general and clearer.  They are supported in GNU {\f1{}make} for compatibility with old makefiles.  They come in two kinds: \'A2double-suffix\'A2 and \'A2single-suffix\'A2.\par
\par
\pard{}A double-suffix rule is defined by a pair of suffixes: the target suffix and the source suffix.  It matches any file whose name ends with the target suffix.  The corresponding implicit prerequisite is made by replacing the target suffix with the source suffix in the file name.  A two-suffix rule whose target and source suffixes are {\f1{}.o} and {\f1{}.c} is equivalent to the pattern rule {\f1{}%.o : %.c}.\par
\par
\pard{}A single-suffix rule is defined by a single suffix, which is the source suffix.  It matches any file name, and the corresponding implicit prerequisite name is made by appending the source suffix.  A single-suffix rule whose source suffix is {\f1{}.c} is equivalent to the pattern rule {\f1{}% : %.c}.\par
\par
\pard{}Suffix rule definitions are recognized by comparing each rule's target against a defined list of known suffixes.  When {\f1{}make} sees a rule whose target is a known suffix, this rule is considered a single-suffix rule.  When {\f1{}make} sees a rule whose target is two known suffixes concatenated, this rule is taken as a double-suffix rule.\par
\par
\pard{}For example, {\f1{}.c} and {\f1{}.o} are both on the default list of known suffixes.  Therefore, if you define a rule whose target is {\f1{}.c.o}, {\f1{}make} takes it to be a double-suffix rule with source suffix {\f1{}.c} and target suffix {\f1{}.o}.  Here is the old-fashioned way to define the rule for compiling a C source file:\par
\par
{\pard\keep\li720\f1{}.c.o:\line
        $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<\par
\pard\f0{}}\par
\pard{}Suffix rules cannot have any prerequisites of their own.  If they have any, they are treated as normal files with funny names, not as suffix rules.  Thus, the rule:\par
\par
{\pard\keep\li720\f1{}.c.o: foo.h\line
        $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<\par
\pard\f0{}}\par
\pard{}tells how to make the file {\f1{}.c.o} from the prerequisite file {\f1{}foo.h}, and is not at all like the pattern rule:\par
\par
{\pard\keep\li720\f1{}%.o: %.c foo.h\line
        $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<\par
\pard\f0{}}\par
\pard{}which tells how to make {\f1{}.o} files from {\f1{}.c} files, and makes all {\f1{}.o} files using this pattern rule also depend on {\f1{}foo.h}.\par
\par
\pard{}Suffix rules with no commands are also meaningless.  They do not remove previous rules as do pattern rules with no commands (see {\uldb Canceling Implicit Rules}{\v Canceling_Rules}).  They simply enter the suffix or pair of suffixes concatenated as a target in the data base.\par
\par
\pard{}{K{\footnote K .SUFFIXES}}The known suffixes are simply the names of the prerequisites of the special target {\f1{}.SUFFIXES}.  You can add your own suffixes by writing a rule for {\f1{}.SUFFIXES} that adds more prerequisites, as in:\par
\par
{\pard\keep\li720\f1{}.SUFFIXES: .hack .win\par
\pard\f0{}}\par
\pard{}which adds {\f1{}.hack} and {\f1{}.win} to the end of the list of suffixes.\par
\par
\pard{}If you wish to eliminate the default known suffixes instead of just adding to them, write a rule for {\f1{}.SUFFIXES} with no prerequisites.  By special dispensation, this eliminates all existing prerequisites of {\f1{}.SUFFIXES}.  You can then write another rule to add the suffixes you want.  For example,\par
\par
{{\pard\keep\li720\f1{}.SUFFIXES:            # Delete the default suffixes\line
.SUFFIXES: .c .o .h   # Define our suffix list\par
\pard\keep\li720{}}}\par
\pard\f0{}The {\f1{}-r} or {\f1{}--no-builtin-rules} flag causes the default list of suffixes to be empty.\par
\par
\pard{}{K{\footnote K SUFFIXES}}The variable {\f1{}SUFFIXES} is defined to the default list of suffixes before {\f1{}make} reads any makefiles.  You can change the list of suffixes with a rule for the special target {\f1{}.SUFFIXES}, but that does not alter this variable.\par
\par
\page\pard Node: {\b Implicit Rule Search}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Suffix Rules}{\v Suffix_Rules}, Up: {\uldb Implicit Rules}{\v Implicit_Rules}\line
K{\footnote K Implicit Rule Search}
#{\footnote Implicit_Rule_Search}
${\footnote \pard{}Implicit Rule Search Algorithm}\par
\pard{\fs24\b Implicit Rule Search Algorithm}\par
\par
\pard{}{K{\footnote K implicit rule, search algorithm}}{K{\footnote K search algorithm, implicit rule}} Here is the procedure {\f1{}make} uses for searching for an implicit rule for a target {\i t}.  This procedure is followed for each double-colon rule with no commands, for each target of ordinary rules none of which have commands, and for each prerequisite that is not the target of any rule.  It is also followed recursively for prerequisites that come from implicit rules, in the search for a chain of rules.\par
\par
\pard{}Suffix rules are not mentioned in this algorithm because suffix rules are converted to equivalent pattern rules once the makefiles have been read in.\par
\par
\pard{}For an archive member target of the form {\f1{}{\i archive}({\i member})}, the following algorithm is run twice, first using the entire target name {\i t}, and second using {\f1{}({\i member})} as the target {\i t} if the first run found no rule.\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}1. \tab{}Split {\i t} into a directory part, called {\i d}, and the rest, called {\i n}.  For example, if {\i t} is {\f1{}src/foo.o}, then {\i d} is {\f1{}src/} and {\i n} is {\f1{}foo.o}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}2. \tab{}Make a list of all the pattern rules one of whose targets matches {\i t} or {\i n}.  If the target pattern contains a slash, it is matched against {\i t}; otherwise, against {\i n}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}3. \tab{}If any rule in that list is {\i not} a match-anything rule, then remove all nonterminal match-anything rules from the list.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}4. \tab{}Remove from the list all rules with no commands.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}5. \tab{}For each pattern rule in the list:\par
\par
{\pard\fi-720\li1440\tx864\tx1440{}\tab{}a.\tab{}Find the stem {\i s}, which is the nonempty part of {\i t} or {\i n} matched by the {\f1{}%} in the target pattern.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}b.\tab{}Compute the prerequisite names by substituting {\i s} for {\f1{}%}; if the target pattern does not contain a slash, append {\i d} to the front of each prerequisite name.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}c.\tab{}Test whether all the prerequisites exist or ought to exist.  (If a file name is mentioned in the makefile as a target or as an explicit prerequisite, then we say it ought to exist.)\par
\par
\pard\li1440{}If all prerequisites exist or ought to exist, or there are no prerequisites, then this rule applies.\par
\pard\li720{}}\par
\pard\fi-720\li720\tx144\tx720{}\tab{}6. \tab{}If no pattern rule has been found so far, try harder.  For each pattern rule in the list:\par
\par
{\pard\fi-720\li1440\tx864\tx1440{}\tab{}a.\tab{}If the rule is terminal, ignore it and go on to the next rule.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}b.\tab{}Compute the prerequisite names as before.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}c.\tab{}Test whether all the prerequisites exist or ought to exist.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}d.\tab{}For each prerequisite that does not exist, follow this algorithm recursively to see if the prerequisite can be made by an implicit rule.\par
\par
\pard\fi-720\li1440\tx864\tx1440{}\tab{}e.\tab{}If all prerequisites exist, ought to exist, or can be made by implicit rules, then this rule applies.\par
\pard\li720{}}\par
\pard\fi-720\li720\tx144\tx720{}\tab{}7. \tab{}If no implicit rule applies, the rule for {\f1{}.DEFAULT}, if any, applies.  In that case, give {\i t} the same commands that {\f1{}.DEFAULT} has.  Otherwise, there are no commands for {\i t}.\par
\pard{}}\par
\pard{}Once a rule that applies has been found, for each target pattern of the rule other than the one that matched {\i t} or {\i n}, the {\f1{}%} in the pattern is replaced with {\i s} and the resultant file name is stored until the commands to remake the target file {\i t} are executed.  After these commands are executed, each of these stored file names are entered into the data base and marked as having been updated and having the same update status as the file {\i t}.\par
\par
\pard{}When the commands of a pattern rule are executed for {\i t}, the automatic variables are set corresponding to the target and prerequisites.  See {\uldb Automatic Variables}{\v Automatic}.\par
\par
\page\pard Node: {\b Archives}, \keepn Next: {\uldb Features}{\v Features}, Prev: {\uldb Implicit Rules}{\v Implicit_Rules}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Archives}
#{\footnote Archives}
${\footnote \pard{}Using {\f1{}make} to Update Archive Files}\par
\pard{\fs24\b Using {\f1{}make} to Update Archive Files}\par
\par
\pard{}{K{\footnote K archive}} \'A2Archive files\'A2 are files containing named subfiles called \'A2members\'A2; they are maintained with the program {\f1{}ar} and their main use is as subroutine libraries for linking.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Archive Members}{\v Archive_Members}\tab Archive members as targets.\par
{\uldb Archive Update}{\v Archive_Update}\tab The implicit rule for archive member targets.\par
{\uldb Archive Pitfalls}{\v Archive_Pitfalls}\tab Dangers to watch out for when using archives.\par
{\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}\tab You can write a special kind of suffix rule for updating archives.\par
\pard{}}\par
\page\pard Node: {\b Archive Members}, \keepn Next: {\uldb Archive Update}{\v Archive_Update}, Prev: {\uldb }{\v }, Up: {\uldb Archives}{\v Archives}\line
K{\footnote K Archive Members}
#{\footnote Archive_Members}
${\footnote \pard{}Archive Members as Targets}\par
\pard{\fs24\b Archive Members as Targets}\par
\par
\pard{}{K{\footnote K archive member targets}} An individual member of an archive file can be used as a target or prerequisite in {\f1{}make}.  You specify the member named {\i member} in archive file {\i archive} as follows:\par
\par
{{\i \pard\li720\f1{}archive}({\i member})\par
\pard\f0{}}\par
\pard{}This construct is available only in targets and prerequisites, not in commands!  Most programs that you might use in commands do not support this syntax and cannot act directly on archive members.  Only {\f1{}ar} and other programs specifically designed to operate on archives can do so.  Therefore, valid commands to update an archive member target probably must use {\f1{}ar}.  For example, this rule says to create a member {\f1{}hack.o} in archive {\f1{}foolib} by copying the file {\f1{}hack.o}:\par
\par
{\pard\keep\li720\f1{}foolib(hack.o) : hack.o\line
        ar cr foolib hack.o\par
\pard\f0{}}\par
\pard{}In fact, nearly all archive member targets are updated in just this way and there is an implicit rule to do it for you.  {\b Note:} The {\f1{}c} flag to {\f1{}ar} is required if the archive file does not already exist.\par
\par
\pard{}To specify several members in the same archive, you can write all the member names together between the parentheses.  For example:\par
\par
{\pard\keep\li720\f1{}foolib(hack.o kludge.o)\par
\pard\f0{}}\par
\pard{}is equivalent to:\par
\par
{\pard\keep\li720\f1{}foolib(hack.o) foolib(kludge.o)\par
\pard\f0{}}\par
\pard{}{K{\footnote K wildcard, in archive member}}You can also use shell-style wildcards in an archive member reference.  See {\uldb Using Wildcard Characters in File Names}{\v Wildcards}.  For example, {\f1{}foolib(*.o)} expands to all existing members of the {\f1{}foolib} archive whose names end in {\f1{}.o}; perhaps {\f1{}foolib(hack.o) foolib(kludge.o)}.\par
\par
\page\pard Node: {\b Archive Update}, \keepn Next: {\uldb Archive Pitfalls}{\v Archive_Pitfalls}, Prev: {\uldb Archive Members}{\v Archive_Members}, Up: {\uldb Archives}{\v Archives}\line
K{\footnote K Archive Update}
#{\footnote Archive_Update}
${\footnote \pard{}Implicit Rule for Archive Member Targets}\par
\pard{\fs24\b Implicit Rule for Archive Member Targets}\par
\par
\pard{}Recall that a target that looks like {\f1{}{\i a}({\i m})} stands for the member named {\i m} in the archive file {\i a}.\par
\par
\pard{}When {\f1{}make} looks for an implicit rule for such a target, as a special feature it considers implicit rules that match {\f1{}({\i m})}, as well as those that match the actual target {\f1{}{\i a}({\i m})}.\par
\par
\pard{}This causes one special rule whose target is {\f1{}(%)} to match.  This rule updates the target {\f1{}{\i a}({\i m})} by copying the file {\i m} into the archive.  For example, it will update the archive member target {\f1{}foo.a(bar.o)} by copying the {\i file} {\f1{}bar.o} into the archive {\f1{}foo.a} as a {\i member} named {\f1{}bar.o}.\par
\par
\pard{}When this rule is chained with others, the result is very powerful.  Thus, {\f1{}make "foo.a(bar.o)"} (the quotes are needed to protect the {\f1{}(} and {\f1{})} from being interpreted specially by the shell) in the presence of a file {\f1{}bar.c} is enough to cause the following commands to be run, even without a makefile:\par
\par
{\pard\keep\li720\f1{}cc -c bar.c -o bar.o\line
ar r foo.a bar.o\line
rm -f bar.o\par
\pard\f0{}}\par
\pard{}Here {\f1{}make} has envisioned the file {\f1{}bar.o} as an intermediate file.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
\pard{}Implicit rules such as this one are written using the automatic variable {\f1{}$%}.  See {\uldb Automatic Variables}{\v Automatic}.\par
\par
\pard{}An archive member name in an archive cannot contain a directory name, but it may be useful in a makefile to pretend that it does.  If you write an archive member target {\f1{}foo.a(dir/file.o)}, {\f1{}make} will perform automatic updating with this command:\par
\par
{\pard\keep\li720\f1{}ar r foo.a dir/file.o\par
\pard\f0{}}\par
\pard{}which has the effect of copying the file {\f1{}dir/file.o} into a member named {\f1{}file.o}.  In connection with such usage, the automatic variables {\f1{}%D} and {\f1{}%F} may be useful.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Archive Symbols}{\v Archive_Symbols}\tab How to update archive symbol directories.\par
\pard{}}\par
\page\pard Node: {\b Archive Symbols}, \keepn Next: {\uldb }{\v }, Prev: {\uldb }{\v }, Up: {\uldb Archive Update}{\v Archive_Update}\line
K{\footnote K Archive Symbols}
#{\footnote Archive_Symbols}
${\footnote \pard{}Updating Archive Symbol Directories}\par
\pard{\fs24\b Updating Archive Symbol Directories}\par
\par
\pard{}{K{\footnote K {\f1{}__.SYMDEF}}}{K{\footnote K updating archive symbol directories}}{K{\footnote K archive symbol directory updating}}{K{\footnote K symbol directories, updating archive}}{K{\footnote K directories, updating archive symbol}} An archive file that is used as a library usually contains a special member named {\f1{}__.SYMDEF} that contains a directory of the external symbol names defined by all the other members.  After you update any other members, you need to update {\f1{}__.SYMDEF} so that it will summarize the other members properly.  This is done by running the {\f1{}ranlib} program:\par
\par
{\pard\keep\li720\f1{}ranlib {\i archivefile}\par
\pard\f0{}}\par
\pard{}Normally you would put this command in the rule for the archive file, and make all the members of the archive file prerequisites of that rule.  For example,\par
\par
{\pard\keep\li720\f1{}libfoo.a: libfoo.a(x.o) libfoo.a(y.o) ...\line
        ranlib libfoo.a\par
\pard\f0{}}\par
\pard{}The effect of this is to update archive members {\f1{}x.o}, {\f1{}y.o}, etc., and then update the symbol directory member {\f1{}__.SYMDEF} by running {\f1{}ranlib}.  The rules for updating the members are not shown here; most likely you can omit them and use the implicit rule which copies files into the archive, as described in the preceding section.\par
\par
\pard{}This is not necessary when using the GNU {\f1{}ar} program, which updates the {\f1{}__.SYMDEF} member automatically.\par
\par
\page\pard Node: {\b Archive Pitfalls}, \keepn Next: {\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}, Prev: {\uldb Archive Update}{\v Archive_Update}, Up: {\uldb Archives}{\v Archives}\line
K{\footnote K Archive Pitfalls}
#{\footnote Archive_Pitfalls}
${\footnote \pard{}Dangers When Using Archives}\par
\pard{\fs24\b Dangers When Using Archives}\par
\par
\pard{}{K{\footnote K archive, and parallel execution}}{K{\footnote K parallel execution, and archive update}}{K{\footnote K archive, and {\f1{}-j}}}{K{\footnote K {\f1{}-j}, and archive update}} It is important to be careful when using parallel execution (the {\f1{}-j} switch; see {\uldb Parallel Execution}{\v Parallel}) and archives.  If multiple {\f1{}ar} commands run at the same time on the same archive file, they will not know about each other and can corrupt the file.\par
\par
\pard{}Possibly a future version of {\f1{}make} will provide a mechanism to circumvent this problem by serializing all commands that operate on the same archive file.  But for the time being, you must either write your makefiles to avoid this problem in some other way, or not use {\f1{}-j}.\par
\par
\page\pard Node: {\b Archive Suffix Rules}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Archive Pitfalls}{\v Archive_Pitfalls}, Up: {\uldb Archives}{\v Archives}\line
K{\footnote K Archive Suffix Rules}
#{\footnote Archive_Suffix_Rules}
${\footnote \pard{}Suffix Rules for Archive Files}\par
\pard{\fs24\b Suffix Rules for Archive Files}\par
\par
\pard{}{K{\footnote K suffix rule, for archive}}{K{\footnote K archive, suffix rule for}}{K{\footnote K library archive, suffix rule for}}{K{\footnote K {\f1{}.a} (archives)}} You can write a special kind of suffix rule for dealing with archive files.  See {\uldb Suffix Rules}{\v Suffix_Rules}, for a full explanation of suffix rules.  Archive suffix rules are obsolete in GNU {\f1{}make}, because pattern rules for archives are a more general mechanism (see {\uldb Archive Update}{\v Archive_Update}).  But they are retained for compatibility with other {\f1{}make}s.\par
\par
\pard{}To write a suffix rule for archives, you simply write a suffix rule using the target suffix {\f1{}.a} (the usual suffix for archive files).  For example, here is the old-fashioned suffix rule to update a library archive from C source files:\par
\par
{{\pard\keep\li720\f1{}.c.a:\line
        $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $*.o\line
        $(AR) r $@ $*.o\line
        $(RM) $*.o\par
\pard\keep\li720{}}}\par
\pard\f0{}This works just as if you had written the pattern rule:\par
\par
{{\pard\keep\li720\f1{}(%.o): %.c\line
        $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $*.o\line
        $(AR) r $@ $*.o\line
        $(RM) $*.o\par
\pard\keep\li720{}}}\par
\pard\f0{}In fact, this is just what {\f1{}make} does when it sees a suffix rule with {\f1{}.a} as the target suffix.  Any double-suffix rule {\f1{}.{\i x}.a} is converted to a pattern rule with the target pattern {\f1{}(%.o)} and a prerequisite pattern of {\f1{}%.{\i x}}.\par
\par
\pard{}Since you might want to use {\f1{}.a} as the suffix for some other kind of file, {\f1{}make} also converts archive suffix rules to pattern rules in the normal way (see {\uldb Suffix Rules}{\v Suffix_Rules}).  Thus a double-suffix rule {\f1{}.{\i x}.a} produces two pattern rules: {\f1{}(%.o): %.{\i x}} and {\f1{}%.a: %.{\i x}}.\par
\par
\page\pard Node: {\b Features}, \keepn Next: {\uldb Missing}{\v Missing}, Prev: {\uldb Archives}{\v Archives}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Features}
#{\footnote Features}
${\footnote \pard{}Features of GNU {\f1{}make}}\par
\pard{\fs24\b Features of GNU {\f1{}make}}\par
\par
\pard{}{K{\footnote K features of GNU {\f1{}make}}}{K{\footnote K portability}}{K{\footnote K compatibility}} Here is a summary of the features of GNU {\f1{}make}, for comparison with and credit to other versions of {\f1{}make}.  We consider the features of {\f1{}make} in 4.2 BSD systems as a baseline.  If you are concerned with writing portable makefiles, you should not use the features of {\f1{}make} listed here, nor the ones in {\uldb Missing}{\v Missing}.\par
\par
\pard{}Many features come from the version of {\f1{}make} in System V.\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The {\f1{}VPATH} variable and its special meaning.  See {\uldb Searching Directories for Prerequisites}{\v Directory_Search}.  This feature exists in System V {\f1{}make}, but is undocumented.  It is documented in 4.3 BSD {\f1{}make} (which says it mimics System V's {\f1{}VPATH} feature).\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Included makefiles.  See {\uldb Including Other Makefiles}{\v Include}.  Allowing multiple files to be included with a single directive is a GNU extension.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Variables are read from and communicated via the environment.  See {\uldb Variables from the Environment}{\v Environment}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Options passed through the variable {\f1{}MAKEFLAGS} to recursive invocations of {\f1{}make}.  See {\uldb Communicating Options to a Sub-{\f1{}make}}{\v Options_Recursion}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The automatic variable {\f1{}$%} is set to the member name in an archive reference.  See {\uldb Automatic Variables}{\v Automatic}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The automatic variables {\f1{}$@}, {\f1{}$*}, {\f1{}$<}, {\f1{}$%}, and {\f1{}$?} have corresponding forms like {\f1{}$(@F)} and {\f1{}$(@D)}.  We have generalized this to {\f1{}$^} as an obvious extension.  See {\uldb Automatic Variables}{\v Automatic}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Substitution variable references.  See {\uldb Basics of Variable References}{\v Reference}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The command-line options {\f1{}-b} and {\f1{}-m}, accepted and ignored.  In System V {\f1{}make}, these options actually do something.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Execution of recursive commands to run {\f1{}make} via the variable {\f1{}MAKE} even if {\f1{}-n}, {\f1{}-q} or {\f1{}-t} is specified.  See {\uldb Recursive Use of {\f1{}make}}{\v Recursion}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Support for suffix {\f1{}.a} in suffix rules.  See {\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}.  This feature is obsolete in GNU {\f1{}make}, because the general feature of rule chaining (see {\uldb Chains of Implicit Rules}{\v Chained_Rules}) allows one pattern rule for installing members in an archive (see {\uldb Archive Update}{\v Archive_Update}) to be sufficient.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The arrangement of lines and backslash-newline combinations in commands is retained when the commands are printed, so they appear as they do in the makefile, except for the stripping of initial whitespace.\par
\pard{}}\par
\pard{}The following features were inspired by various other versions of {\f1{}make}.  In some cases it is unclear exactly which versions inspired which others.\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Pattern rules using {\f1{}%}.  This has been implemented in several versions of {\f1{}make}.  We're not sure who invented it first, but it's been spread around a bit.  See {\uldb Defining and Redefining Pattern Rules}{\v Pattern_Rules}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Rule chaining and implicit intermediate files.  This was implemented by Stu Feldman in his version of {\f1{}make} for AT&T Eighth Edition Research Unix, and later by Andrew Hume of AT&T Bell Labs in his {\f1{}mk} program (where he terms it "transitive closure").  We do not really know if we got this from either of them or thought it up ourselves at the same time.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The automatic variable {\f1{}$^} containing a list of all prerequisites of the current target.  We did not invent this, but we have no idea who did.  See {\uldb Automatic Variables}{\v Automatic}.  The automatic variable {\f1{}$+} is a simple extension of {\f1{}$^}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The "what if" flag ({\f1{}-W} in GNU {\f1{}make}) was (as far as we know) invented by Andrew Hume in {\f1{}mk}.  See {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The concept of doing several things at once (parallelism) exists in many incarnations of {\f1{}make} and similar programs, though not in the System V or BSD implementations.  See {\uldb Command Execution}{\v Execution}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Modified variable references using pattern substitution come from SunOS 4.  See {\uldb Basics of Variable References}{\v Reference}.  This functionality was provided in GNU {\f1{}make} by the {\f1{}patsubst} function before the alternate syntax was implemented for compatibility with SunOS 4.  It is not altogether clear who inspired whom, since GNU {\f1{}make} had {\f1{}patsubst} before SunOS 4 was released.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The special significance of {\f1{}+} characters preceding command lines (see {\uldb Instead of Executing the Commands}{\v Instead_of_Execution}) is mandated by {\i IEEE Standard 1003.2-1992} (POSIX.2).\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The {\f1{}+=} syntax to append to the value of a variable comes from SunOS 4 {\f1{}make}.  See {\uldb Appending More Text to Variables}{\v Appending}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The syntax {\f1{}{\i archive}({\i mem1} {\i mem2}...)} to list multiple members in a single archive file comes from SunOS 4 {\f1{}make}.  See {\uldb Archive Members}{\v Archive_Members}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The {\f1{}-include} directive to include makefiles with no error for a nonexistent file comes from SunOS 4 {\f1{}make}.  (But note that SunOS 4 {\f1{}make} does not allow multiple makefiles to be specified in one {\f1{}-include} directive.)  The same feature appears with the name {\f1{}sinclude} in SGI {\f1{}make} and perhaps others.\par
\pard{}}\par
\pard{}The remaining features are inventions new in GNU {\f1{}make}:\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Use the {\f1{}-v} or {\f1{}--version} option to print version and copyright information.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Use the {\f1{}-h} or {\f1{}--help} option to summarize the options to {\f1{}make}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Simply-expanded variables.  See {\uldb The Two Flavors of Variables}{\v Flavors}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Pass command-line variable assignments automatically through the variable {\f1{}MAKE} to recursive {\f1{}make} invocations.  See {\uldb Recursive Use of {\f1{}make}}{\v Recursion}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Use the {\f1{}-C} or {\f1{}--directory} command option to change directory.  See {\uldb Summary of Options}{\v Options_Summary}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Make verbatim variable definitions with {\f1{}define}.  See {\uldb Defining Variables Verbatim}{\v Defining}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Declare phony targets with the special target {\f1{}.PHONY}.\par
\par
\pard\li720{}Andrew Hume of AT&T Bell Labs implemented a similar feature with a different syntax in his {\f1{}mk} program.  This seems to be a case of parallel discovery.  See {\uldb Phony Targets}{\v Phony_Targets}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Manipulate text by calling functions.  See {\uldb Functions for Transforming Text}{\v Functions}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Use the {\f1{}-o} or {\f1{}--old-file} option to pretend a file's modification-time is old.  See {\uldb Avoiding Recompilation of Some Files}{\v Avoiding_Compilation}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Conditional execution.\par
\par
\pard\li720{}This feature has been implemented numerous times in various versions of {\f1{}make}; it seems a natural extension derived from the features of the C preprocessor and similar macro languages and is not a revolutionary concept.  See {\uldb Conditional Parts of Makefiles}{\v Conditionals}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Specify a search path for included makefiles.  See {\uldb Including Other Makefiles}{\v Include}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Specify extra makefiles to read with an environment variable.  See {\uldb The Variable {\f1{}MAKEFILES}}{\v MAKEFILES_Variable}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Strip leading sequences of {\f1{}./} from file names, so that {\f1{}./{\i file}} and {\f1{}{\i file}} are considered to be the same file.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Use a special search method for library prerequisites written in the form {\f1{}-l{\i name}}.  See {\uldb Directory Search for Link Libraries}{\v Libraries_Search}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Allow suffixes for suffix rules (see {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}) to contain any characters.  In other versions of {\f1{}make}, they must begin with {\f1{}.} and not contain any {\f1{}/} characters.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Keep track of the current level of {\f1{}make} recursion using the variable {\f1{}MAKELEVEL}.  See {\uldb Recursive Use of {\f1{}make}}{\v Recursion}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Provide any goals given on the command line in the variable {\f1{}MAKECMDGOALS}.  See {\uldb Arguments to Specify the Goals}{\v Goals}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Specify static pattern rules.  See {\uldb Static Pattern Rules}{\v Static_Pattern}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Provide selective {\f1{}vpath} search.  See {\uldb Searching Directories for Prerequisites}{\v Directory_Search}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Provide computed variable references.  See {\uldb Basics of Variable References}{\v Reference}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Update makefiles.  See {\uldb How Makefiles Are Remade}{\v Remaking_Makefiles}.  System V {\f1{}make} has a very, very limited form of this functionality in that it will check out SCCS files for makefiles.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Various new built-in implicit rules.  See {\uldb Catalogue of Implicit Rules}{\v Catalogue_of_Rules}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}The built-in variable {\f1{}MAKE_VERSION} gives the version number of {\f1{}make}.\par
\pard{}}\par
\page\pard Node: {\b Missing}, \keepn Next: {\uldb Makefile Conventions}{\v Makefile_Conventions}, Prev: {\uldb Features}{\v Features}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Missing}
#{\footnote Missing}
${\footnote \pard{}Incompatibilities and Missing Features}\par
\pard{\fs24\b Incompatibilities and Missing Features}\par
\par
\pard{}{K{\footnote K incompatibilities}}{K{\footnote K missing features}}{K{\footnote K features, missing}} The {\f1{}make} programs in various other systems support a few features that are not implemented in GNU {\f1{}make}.  The POSIX.2 standard ({\i IEEE Standard 1003.2-1992}) which specifies {\f1{}make} does not require any of these features.\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}A target of the form {\f1{}{\i file}(({\i entry}))} stands for a member of archive file {\i file}.  The member is chosen, not by name, but by being an object file which defines the linker symbol {\i entry}.\par
\par
\pard\li720{}This feature was not put into GNU {\f1{}make} because of the nonmodularity of putting knowledge into {\f1{}make} of the internal format of archive file symbol tables.  See {\uldb Updating Archive Symbol Directories}{\v Archive_Symbols}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Suffixes (used in suffix rules) that end with the character {\f1{}~} have a special meaning to System V {\f1{}make}; they refer to the SCCS file that corresponds to the file one would get without the {\f1{}~}.  For example, the suffix rule {\f1{}.c~.o} would make the file {\f1{}{\i n}.o} from the SCCS file {\f1{}s.{\i n}.c}.  For complete coverage, a whole series of such suffix rules is required.  See {\uldb Old-Fashioned Suffix Rules}{\v Suffix_Rules}.\par
\par
\pard\li720{}In GNU {\f1{}make}, this entire series of cases is handled by two pattern rules for extraction from SCCS, in combination with the general feature of rule chaining.  See {\uldb Chains of Implicit Rules}{\v Chained_Rules}.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}In System V {\f1{}make}, the string {\f1{}$$@} has the strange meaning that, in the prerequisites of a rule with multiple targets, it stands for the particular target that is being processed.\par
\par
\pard\li720{}This is not defined in GNU {\f1{}make} because {\f1{}$$} should always stand for an ordinary {\f1{}$}.\par
\par
\pard\li720{}It is possible to get portions of this functionality through the use of static pattern rules (see {\uldb Static Pattern Rules}{\v Static_Pattern}).  The System V {\f1{}make} rule:\par
\par
{\pard\keep\li1440\f1{}$(targets): $$@.o lib.a\par
\pard\li720\f0{}}\par
\pard\li720{}can be replaced with the GNU {\f1{}make} static pattern rule:\par
\par
{\pard\keep\li1440\f1{}$(targets): %: %.o lib.a\par
\pard\li720\f0{}}\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}In System V and 4.3 BSD {\f1{}make}, files found by {\f1{}VPATH} search (see {\uldb Searching Directories for Prerequisites}{\v Directory_Search}) have their names changed inside command strings.  We feel it is much cleaner to always use automatic variables and thus make this feature obsolete.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}In some Unix {\f1{}make}s, the automatic variable {\f1{}$*} appearing in the prerequisites of a rule has the amazingly strange "feature" of expanding to the full name of the {\i target of that rule}.  We cannot imagine what went on in the minds of Unix {\f1{}make} developers to do this; it is utterly inconsistent with the normal definition of {\f1{}$*}.  {K{\footnote K * (automatic variable), unsupported bizarre usage}}\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}In some Unix {\f1{}make}s, implicit rule search (see {\uldb Using Implicit Rules}{\v Implicit_Rules}) is apparently done for {\i all} targets, not just those without commands.  This means you can do:\par
\par
{{\pard\keep\li1440\f1{}foo.o:\line
        cc -c foo.c\par
\pard\keep\li1440{}}}\par
\pard\li720\f0{}and Unix {\f1{}make} will intuit that {\f1{}foo.o} depends on {\f1{}foo.c}.\par
\par
\pard\li720{}We feel that such usage is broken.  The prerequisite properties of {\f1{}make} are well-defined (for GNU {\f1{}make}, at least), and doing such a thing simply does not fit the model.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}GNU {\f1{}make} does not include any built-in implicit rules for compiling or preprocessing EFL programs.  If we hear of anyone who is using EFL, we will gladly add them.\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}It appears that in SVR4 {\f1{}make}, a suffix rule can be specified with no commands, and it is treated as if it had empty commands (see {\uldb Empty Commands}{\v Empty_Commands}).  For example:\par
\par
{\pard\keep\li1440\f1{}.c.a:\par
\pard\li720\f0{}}\par
\pard\li720{}will override the built-in {\f1{}.c.a} suffix rule.\par
\par
\pard\li720{}We feel that it is cleaner for a rule without commands to always simply add to the prerequisite list for the target.  The above example can be easily rewritten to get the desired behavior in GNU {\f1{}make}:\par
\par
{\pard\keep\li1440\f1{}.c.a: ;\par
\pard\li720\f0{}}\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Some versions of {\f1{}make} invoke the shell with the {\f1{}-e} flag, except under {\f1{}-k} (see {\uldb Testing the Compilation of a Program}{\v Testing}).  The {\f1{}-e} flag tells the shell to exit as soon as any program it runs returns a nonzero status.  We feel it is cleaner to write each shell command line to stand on its own and not require this special treatment.\par
\pard{}}\par
\page\pard Node: {\b Makefile Conventions}, \keepn Next: {\uldb Quick Reference}{\v Quick_Reference}, Prev: {\uldb Missing}{\v Missing}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Makefile Conventions}
#{\footnote Makefile_Conventions}
${\footnote \pard{}Makefile Conventions}\par
\pard{\fs24\b Makefile Conventions}\par
\par
\pard{}{K{\footnote K makefile, conventions for}}{K{\footnote K conventions for makefiles}}{K{\footnote K standards for makefiles}} This {node }describes conventions for writing the Makefiles for GNU programs.  Using Automake will help you write a Makefile that follows these conventions.\par
\par
{\par
\pard\keep\fi-2880\li2880\tx2880{}{\uldb Makefile Basics}{\v Makefile_Basics}\tab General Conventions for Makefiles\par
{\uldb Utilities in Makefiles}{\v Utilities_in_Makefiles}\tab Utilities in Makefiles\par
{\uldb Command Variables}{\v Command_Variables}\tab Variables for Specifying Commands\par
{\uldb Directory Variables}{\v Directory_Variables}\tab Variables for Installation Directories\par
{\uldb Standard Targets}{\v Standard_Targets}\tab Standard Targets for Users\par
{\uldb Install Command Categories}{\v Install_Command_Categories}\tab Three categories of commands in the `install' rule: normal, pre-install and post-install.\par
\pard{}}\par
\page\pard Node: {\b Makefile Basics}, \keepn Next: {\uldb Utilities in Makefiles}{\v Utilities_in_Makefiles}, Prev: {\uldb }{\v }, Up: {\uldb Makefile Conventions}{\v Makefile_Conventions}\line
K{\footnote K Makefile Basics}
#{\footnote Makefile_Basics}
${\footnote \pard{}General Conventions for Makefiles}\par
\pard{\fs24\b General Conventions for Makefiles}\par
\par
\pard{}Every Makefile should contain this line:\par
\par
{\pard\keep\li720\f1{}SHELL = /bin/sh\par
\pard\f0{}}\par
\pard{}to avoid trouble on systems where the {\f1{}SHELL} variable might be inherited from the environment.  (This is never a problem with GNU {\f1{}make}.)\par
\par
\pard{}Different {\f1{}make} programs have incompatible suffix lists and implicit rules, and this sometimes creates confusion or misbehavior.  So it is a good idea to set the suffix list explicitly using only the suffixes you need in the particular Makefile, like this:\par
\par
{\pard\keep\li720\f1{}.SUFFIXES:\line
.SUFFIXES: .c .o\par
\pard\f0{}}\par
\pard{}The first line clears out the suffix list, the second introduces all suffixes which may be subject to implicit rules in this Makefile.\par
\par
\pard{}Don't assume that {\f1{}.} is in the path for command execution.  When you need to run programs that are a part of your package during the make, please make sure that it uses {\f1{}./} if the program is built as part of the make or {\f1{}$(srcdir)/} if the file is an unchanging part of the source code.  Without one of these prefixes, the current search path is used.\par
\par
\pard{}The distinction between {\f1{}./} (the \'A2build directory\'A2) and {\f1{}$(srcdir)/} (the \'A2source directory\'A2) is important because users can build in a separate directory using the {\f1{}--srcdir} option to {\f1{}configure}.  A rule of the form:\par
\par
{\pard\keep\li720\f1{}foo.1 : foo.man sedscript\line
        sed -e sedscript foo.man > foo.1\par
\pard\f0{}}\par
\pard{}will fail when the build directory is not the source directory, because {\f1{}foo.man} and {\f1{}sedscript} are in the the source directory.\par
\par
\pard{}When using GNU {\f1{}make}, relying on {\f1{}VPATH} to find the source file will work in the case where there is a single dependency file, since the {\f1{}make} automatic variable {\f1{}$<} will represent the source file wherever it is.  (Many versions of {\f1{}make} set {\f1{}$<} only in implicit rules.)  A Makefile target like\par
\par
{\pard\keep\li720\f1{}foo.o : bar.c\line
        $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o\par
\pard\f0{}}\par
\pard{}should instead be written as\par
\par
{\pard\keep\li720\f1{}foo.o : bar.c\line
        $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@\par
\pard\f0{}}\par
\pard{}in order to allow {\f1{}VPATH} to work correctly.  When the target has multiple dependencies, using an explicit {\f1{}$(srcdir)} is the easiest way to make the rule work well.  For example, the target above for {\f1{}foo.1} is best written as:\par
\par
{\pard\keep\li720\f1{}foo.1 : foo.man sedscript\line
        sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@\par
\pard\f0{}}\par
\pard{}GNU distributions usually contain some files which are not source files--for example, Info files, and the output from Autoconf, Automake, Bison or Flex.  Since these files normally appear in the source directory, they should always appear in the source directory, not in the build directory.  So Makefile rules to update them should put the updated files in the source directory.\par
\par
\pard{}However, if a file does not appear in the distribution, then the Makefile should not put it in the source directory, because building a program in ordinary circumstances should not modify the source directory in any way.\par
\par
\pard{}Try to make the build and installation targets, at least (and all their subtargets) work correctly with a parallel {\f1{}make}.\par
\par
\page\pard Node: {\b Utilities in Makefiles}, \keepn Next: {\uldb Command Variables}{\v Command_Variables}, Prev: {\uldb Makefile Basics}{\v Makefile_Basics}, Up: {\uldb Makefile Conventions}{\v Makefile_Conventions}\line
K{\footnote K Utilities in Makefiles}
#{\footnote Utilities_in_Makefiles}
${\footnote \pard{}Utilities in Makefiles}\par
\pard{\fs24\b Utilities in Makefiles}\par
\par
\pard{}Write the Makefile commands (and any shell scripts, such as {\f1{}configure}) to run in {\f1{}sh}, not in {\f1{}csh}.  Don't use any special features of {\f1{}ksh} or {\f1{}bash}.\par
\par
\pard{}The {\f1{}configure} script and the Makefile rules for building and installation should not use any utilities directly except these:\par
\par
{\pard\keep\li720\f1{}cat cmp cp diff echo egrep expr false grep install-info\line
ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true\par
\pard\f0{}}\par
\pard{}The compression program {\f1{}gzip} can be used in the {\f1{}dist} rule.\par
\par
\pard{}Stick to the generally supported options for these programs.  For example, don't use {\f1{}mkdir -p}, convenient as it may be, because most systems don't support it.\par
\par
\pard{}It is a good idea to avoid creating symbolic links in makefiles, since a few systems don't support them.\par
\par
\pard{}The Makefile rules for building and installation can also use compilers and related programs, but should do so via {\f1{}make} variables so that the user can substitute alternatives.  Here are some of the programs we mean:\par
\par
{\pard\keep\li720\f1{}ar bison cc flex install ld ldconfig lex\line
make makeinfo ranlib texi2dvi yacc\par
\pard\f0{}}\par
\pard{}Use the following {\f1{}make} variables to run those programs:\par
\par
{\pard\keep\li720\f1{}$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)\line
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)\par
\pard\f0{}}\par
\pard{}When you use {\f1{}ranlib} or {\f1{}ldconfig}, you should make sure nothing bad happens if the system does not have the program in question.  Arrange to ignore an error from that command, and print a message before the command to tell the user that failure of this command does not mean a problem.  (The Autoconf {\f1{}AC_PROG_RANLIB} macro can help with this.)\par
\par
\pard{}If you use symbolic links, you should implement a fallback for systems that don't have symbolic links.\par
\par
\pard{}Additional utilities that can be used via Make variables are:\par
\par
{\pard\keep\li720\f1{}chgrp chmod chown mknod\par
\pard\f0{}}\par
\pard{}It is ok to use other utilities in Makefile portions (or scripts) intended only for particular systems where you know those utilities exist.\par
\par
\page\pard Node: {\b Command Variables}, \keepn Next: {\uldb Directory Variables}{\v Directory_Variables}, Prev: {\uldb Utilities in Makefiles}{\v Utilities_in_Makefiles}, Up: {\uldb Makefile Conventions}{\v Makefile_Conventions}\line
K{\footnote K Command Variables}
#{\footnote Command_Variables}
${\footnote \pard{}Variables for Specifying Commands}\par
\pard{\fs24\b Variables for Specifying Commands}\par
\par
\pard{}Makefiles should provide variables for overriding certain commands, options, and so on.\par
\par
\pard{}In particular, you should run most utility programs via variables.  Thus, if you use Bison, have a variable named {\f1{}BISON} whose default value is set with {\f1{}BISON = bison}, and refer to it with {\f1{}$(BISON)} whenever you need to use Bison.\par
\par
\pard{}File management utilities such as {\f1{}ln}, {\f1{}rm}, {\f1{}mv}, and so on, need not be referred to through variables in this way, since users don't need to replace them with other programs.\par
\par
\pard{}Each program-name variable should come with an options variable that is used to supply options to the program.  Append {\f1{}FLAGS} to the program-name variable name to get the options variable name--for example, {\f1{}BISONFLAGS}.  (The names {\f1{}CFLAGS} for the C compiler, {\f1{}YFLAGS} for yacc, and {\f1{}LFLAGS} for lex, are exceptions to this rule, but we keep them because they are standard.)  Use {\f1{}CPPFLAGS} in any compilation command that runs the preprocessor, and use {\f1{}LDFLAGS} in any compilation command that does linking as well as in any direct use of {\f1{}ld}.\par
\par
\pard{}If there are C compiler options that {\i must} be used for proper compilation of certain files, do not include them in {\f1{}CFLAGS}.  Users expect to be able to specify {\f1{}CFLAGS} freely themselves.  Instead, arrange to pass the necessary options to the C compiler independently of {\f1{}CFLAGS}, by writing them explicitly in the compilation commands or by defining an implicit rule, like this:\par
\par
{\pard\keep\li720\f1{}CFLAGS = -g\line
ALL_CFLAGS = -I. $(CFLAGS)\line
.c.o:\line
        $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<\par
\pard\f0{}}\par
\pard{}Do include the {\f1{}-g} option in {\f1{}CFLAGS}, because that is not {\i required} for proper compilation.  You can consider it a default that is only recommended.  If the package is set up so that it is compiled with GCC by default, then you might as well include {\f1{}-O} in the default value of {\f1{}CFLAGS} as well.\par
\par
\pard{}Put {\f1{}CFLAGS} last in the compilation command, after other variables containing compiler options, so the user can use {\f1{}CFLAGS} to override the others.\par
\par
{\f1{}\pard{}CFLAGS} should be used in every invocation of the C compiler, both those which do compilation and those which do linking.\par
\par
\pard{}Every Makefile should define the variable {\f1{}INSTALL}, which is the basic command for installing a file into the system.\par
\par
\pard{}Every Makefile should also define the variables {\f1{}INSTALL_PROGRAM} and {\f1{}INSTALL_DATA}.  (The default for each of these should be {\f1{}$(INSTALL)}.)  Then it should use those variables as the commands for actual installation, for executables and nonexecutables respectively.  Use these variables as follows:\par
\par
{\pard\keep\li720\f1{}$(INSTALL_PROGRAM) foo $(bindir)/foo\line
$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a\par
\pard\f0{}}\par
\pard{}Optionally, you may prepend the value of {\f1{}DESTDIR} to the target filename.  Doing this allows the installer to create a snapshot of the installation to be copied onto the real target filesystem later.  Do not set the value of {\f1{}DESTDIR} in your Makefile, and do not include it in any installed files.  With support for {\f1{}DESTDIR}, the above examples become:\par
\par
{\pard\keep\li720\f1{}$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo\line
$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a\par
\pard\f0{}}\par
\pard{}Always use a file name, not a directory name, as the second argument of the installation commands.  Use a separate command for each file to be installed.\par
\par
\page\pard Node: {\b Directory Variables}, \keepn Next: {\uldb Standard Targets}{\v Standard_Targets}, Prev: {\uldb Command Variables}{\v Command_Variables}, Up: {\uldb Makefile Conventions}{\v Makefile_Conventions}\line
K{\footnote K Directory Variables}
#{\footnote Directory_Variables}
${\footnote \pard{}Variables for Installation Directories}\par
\pard{\fs24\b Variables for Installation Directories}\par
\par
\pard{}Installation directories should always be named by variables, so it is easy to install in a nonstandard place.  The standard names for these variables are described below.  They are based on a standard filesystem layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and other modern operating systems.\par
\par
\pard{}These two variables set the root for the installation.  All the other installation directories should be subdirectories of one of these two, and nothing should be directly installed into these two directories.\par
\par
{\pard{}{\f1{}prefix}\par
\pard\li720{}A prefix used in constructing the default values of the variables listed below.  The default value of {\f1{}prefix} should be {\f1{}/usr/local}.  When building the complete GNU system, the prefix will be empty and {\f1{}/usr} will be a symbolic link to {\f1{}/}.  (If you are using Autoconf, write it as {\f1{}@prefix@}.)\par
\par
\pard\li720{}Running {\f1{}make install} with a different value of {\f1{}prefix} from the one used to build the program should {\i not} recompile the program.\par
\par
\pard{}{\f1{}exec_prefix}\par
\pard\li720{}A prefix used in constructing the default values of some of the variables listed below.  The default value of {\f1{}exec_prefix} should be {\f1{}$(prefix)}.  (If you are using Autoconf, write it as {\f1{}@exec_prefix@}.)\par
\par
\pard\li720{}Generally, {\f1{}$(exec_prefix)} is used for directories that contain machine-specific files (such as executables and subroutine libraries), while {\f1{}$(prefix)} is used directly for other directories.\par
\par
\pard\li720{}Running {\f1{}make install} with a different value of {\f1{}exec_prefix} from the one used to build the program should {\i not} recompile the program.\par
\pard{}}\par
\pard{}Executable programs are installed in one of the following directories.\par
\par
{\pard{}{\f1{}bindir}\par
\pard\li720{}The directory for installing executable programs that users can run.  This should normally be {\f1{}/usr/local/bin}, but write it as {\f1{}$(exec_prefix)/bin}.  (If you are using Autoconf, write it as {\f1{}@bindir@}.)\par
\par
\pard{}{\f1{}sbindir}\par
\pard\li720{}The directory for installing executable programs that can be run from the shell, but are only generally useful to system administrators.  This should normally be {\f1{}/usr/local/sbin}, but write it as {\f1{}$(exec_prefix)/sbin}.  (If you are using Autoconf, write it as {\f1{}@sbindir@}.)\par
\par
\pard{}{\f1{}libexecdir}\par
\pard\li720{}The directory for installing executable programs to be run by other programs rather than by users.  This directory should normally be {\f1{}/usr/local/libexec}, but write it as {\f1{}$(exec_prefix)/libexec}.  (If you are using Autoconf, write it as {\f1{}@libexecdir@}.)\par
\pard{}}\par
\pard{}Data files used by the program during its execution are divided into categories in two ways.\par
\par
{\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Some files are normally modified by programs; others are never normally modified (though users may edit some of these).\par
\par
\pard\fi-720\li720\tx144\tx720{}\tab{}{\f2\'B7}\tab{}Some files are architecture-independent and can be shared by all machines at a site; some are architecture-dependent and can be shared only by machines of the same kind and operating system; others may never be shared between two machines.\par
\pard{}}\par
\pard{}This makes for six different possibilities.  However, we want to discourage the use of architecture-dependent files, aside from object files and libraries.  It is much cleaner to make other data files architecture-independent, and it is generally not hard.\par
\par
\pard{}Therefore, here are the variables Makefiles should use to specify directories:\par
\par
{\pard{}{\f1{}datadir}\par
\pard\li720{}The directory for installing read-only architecture independent data files.  This should normally be {\f1{}/usr/local/share}, but write it as {\f1{}$(prefix)/share}.  (If you are using Autoconf, write it as {\f1{}@datadir@}.)  As a special exception, see {\f1{}$(infodir)} and {\f1{}$(includedir)} below.\par
\par
\pard{}{\f1{}sysconfdir}\par
\pard\li720{}The directory for installing read-only data files that pertain to a single machine-that is to say, files for configuring a host.  Mailer and network configuration files, {\f1{}/etc/passwd}, and so forth belong here.  All the files in this directory should be ordinary ASCII text files.  This directory should normally be {\f1{}/usr/local/etc}, but write it as {\f1{}$(prefix)/etc}.  (If you are using Autoconf, write it as {\f1{}@sysconfdir@}.)\par
\par
\pard\li720{}Do not install executables here in this directory (they probably belong in {\f1{}$(libexecdir)} or {\f1{}$(sbindir)}).  Also do not install files that are modified in the normal course of their use (programs whose purpose is to change the configuration of the system excluded).  Those probably belong in {\f1{}$(localstatedir)}.\par
\par
\pard{}{\f1{}sharedstatedir}\par
\pard\li720{}The directory for installing architecture-independent data files which the programs modify while they run.  This should normally be {\f1{}/usr/local/com}, but write it as {\f1{}$(prefix)/com}.  (If you are using Autoconf, write it as {\f1{}@sharedstatedir@}.)\par
\par
\pard{}{\f1{}localstatedir}\par
\pard\li720{}The directory for installing data files which the programs modify while they run, and that pertain to one specific machine.  Users should never need to modify files in this directory to configure the package's operation; put such configuration information in separate files that go in {\f1{}$(datadir)} or {\f1{}$(sysconfdir)}.  {\f1{}$(localstatedir)} should normally be {\f1{}/usr/local/var}, but write it as {\f1{}$(prefix)/var}.  (If you are using Autoconf, write it as {\f1{}@localstatedir@}.)\par
\par
\pard{}{\f1{}libdir}\par
\pard\li720{}The directory for object files and libraries of object code.  Do not install executables here, they probably ought to go in {\f1{}$(libexecdir)} instead.  The value of {\f1{}libdir} should normally be {\f1{}/usr/local/lib}, but write it as {\f1{}$(exec_prefix)/lib}.  (If you are using Autoconf, write it as {\f1{}@libdir@}.)\par
\par
\pard{}{\f1{}infodir}\par
\pard\li720{}The directory for installing the Info files for this package.  By default, it should be {\f1{}/usr/local/info}, but it should be written as {\f1{}$(prefix)/info}.  (If you are using Autoconf, write it as {\f1{}@infodir@}.)\par
\par
\pard{}{\f1{}lispdir}\par
\pard\li720{}The directory for installing any Emacs Lisp files in this package.  By default, it should be {\f1{}/usr/local/share/emacs/site-lisp}, but it should be written as {\f1{}$(prefix)/share/emacs/site-lisp}.\par
\par
\pard\li720{}If you are using Autoconf, write the default as {\f1{}@lispdir@}.  In order to make {\f1{}@lispdir@} work, you need the following lines in your {\f1{}configure.in} file:\par
\par
{\pard\keep\li1440\f1{}lispdir='$\'7Bdatadir\'7D/emacs/site-lisp'\line
AC_SUBST(lispdir)\par
\pard\li720\f0{}}\par
\pard{}{\f1{}includedir}\par
\pard\li720{}The directory for installing header files to be included by user programs with the C {\f1{}#include} preprocessor directive.  This should normally be {\f1{}/usr/local/include}, but write it as {\f1{}$(prefix)/include}.  (If you are using Autoconf, write it as {\f1{}@includedir@}.)\par
\par
\pard\li720{}Most compilers other than GCC do not look for header files in directory {\f1{}/usr/local/include}.  So installing the header files this way is only useful with GCC.  Sometimes this is not a problem because some libraries are only really intended to work with GCC.  But some libraries are intended to work with other compilers.  They should install their header files in two places, one specified by {\f1{}includedir} and one specified by {\f1{}oldincludedir}.\par
\par
\pard{}{\f1{}oldincludedir}\par
\pard\li720{}The directory for installing {\f1{}#include} header files for use with compilers other than GCC.  This should normally be {\f1{}/usr/include}.  (If you are using Autoconf, you can write it as {\f1{}@oldincludedir@}.)\par
\par
\pard\li720{}The Makefile commands should check whether the value of {\f1{}oldincludedir} is empty.  If it is, they should not try to use it; they should cancel the second installation of the header files.\par
\par
\pard\li720{}A package should not replace an existing header in this directory unless the header came from the same package.  Thus, if your Foo package provides a header file {\f1{}foo.h}, then it should install the header file in the {\f1{}oldincludedir} directory if either (1) there is no {\f1{}foo.h} there or (2) the {\f1{}foo.h} that exists came from the Foo package.\par
\par
\pard\li720{}To tell whether {\f1{}foo.h} came from the Foo package, put a magic string in the file--part of a comment--and {\f1{}grep} for that string.\par
\pard{}}\par
\pard{}Unix-style man pages are installed in one of the following:\par
\par
{\pard{}{\f1{}mandir}\par
\pard\li720{}The top-level directory for installing the man pages (if any) for this package.  It will normally be {\f1{}/usr/local/man}, but you should write it as {\f1{}$(prefix)/man}.  (If you are using Autoconf, write it as {\f1{}@mandir@}.)\par
\par
\pard{}{\f1{}man1dir}\par
\pard\li720{}The directory for installing section 1 man pages.  Write it as {\f1{}$(mandir)/man1}.\par
\par
\pard{}{\f1{}man2dir}\par
\pard\li720{}The directory for installing section 2 man pages.  Write it as {\f1{}$(mandir)/man2}\par
\par
\pard{}{\f1{}...}\par
{\b \pard\li720{}Don't make the primary documentation for any GNU software be a man page.  Write a manual in Texinfo instead.  Man pages are just for the sake of people running GNU software on Unix, which is a secondary application only.}\par
\par
\pard{}{\f1{}manext}\par
\pard\li720{}The file name extension for the installed man page.  This should contain a period followed by the appropriate digit; it should normally be {\f1{}.1}.\par
\par
\pard{}{\f1{}man1ext}\par
\pard\li720{}The file name extension for installed section 1 man pages.\par
\par
\pard{}{\f1{}man2ext}\par
\pard\li720{}The file name extension for installed section 2 man pages.\par
\par
\pard{}{\f1{}...}\par
\pard\li720{}Use these names instead of {\f1{}manext} if the package needs to install man pages in more than one section of the manual.\par
\pard{}}\par
\pard{}And finally, you should set the following variable:\par
\par
{\pard{}{\f1{}srcdir}\par
\pard\li720{}The directory for the sources being compiled.  The value of this variable is normally inserted by the {\f1{}configure} shell script.  (If you are using Autconf, use {\f1{}srcdir = @srcdir@}.)\par
\pard{}}\par
\pard{}For example:\par
\par
{\pard\keep\li720\f1{}# Common prefix for installation directories.\line
# NOTE: This directory must exist when you start the install.\line
prefix = /usr/local\line
exec_prefix = $(prefix)\line
# Where to put the executable for the command `gcc'.\line
bindir = $(exec_prefix)/bin\line
# Where to put the directories used by the compiler.\line
libexecdir = $(exec_prefix)/libexec\line
# Where to put the Info files.\line
infodir = $(prefix)/info\par
\pard\f0{}}\par
\pard{}If your program installs a large number of files into one of the standard user-specified directories, it might be useful to group them into a subdirectory particular to that program.  If you do this, you should write the {\f1{}install} rule to create these subdirectories.\par
\par
\pard{}Do not expect the user to include the subdirectory name in the value of any of the variables listed above.  The idea of having a uniform set of variable names for installation directories is to enable the user to specify the exact same values for several different GNU packages.  In order for this to be useful, all the packages must be designed so that they will work sensibly when the user does so.\par
\par
\page\pard Node: {\b Standard Targets}, \keepn Next: {\uldb Install Command Categories}{\v Install_Command_Categories}, Prev: {\uldb Directory Variables}{\v Directory_Variables}, Up: {\uldb Makefile Conventions}{\v Makefile_Conventions}\line
K{\footnote K Standard Targets}
#{\footnote Standard_Targets}
${\footnote \pard{}Standard Targets for Users}\par
\pard{\fs24\b Standard Targets for Users}\par
\par
\pard{}All GNU programs should have the following targets in their Makefiles:\par
\par
{\pard{}{\f1{}all}\par
\pard\li720{}Compile the entire program.  This should be the default target.  This target need not rebuild any documentation files; Info files should normally be included in the distribution, and DVI files should be made only when explicitly asked for.\par
\par
\pard\li720{}By default, the Make rules should compile and link with {\f1{}-g}, so that executable programs have debugging symbols.  Users who don't mind being helpless can strip the executables later if they wish.\par
\par
\pard{}{\f1{}install}\par
\pard\li720{}Compile the program and copy the executables, libraries, and so on to the file names where they should reside for actual use.  If there is a simple test to verify that a program is properly installed, this target should run that test.\par
\par
\pard\li720{}Do not strip executables when installing them.  Devil-may-care users can use the {\f1{}install-strip} target to do that.\par
\par
\pard\li720{}If possible, write the {\f1{}install} target rule so that it does not modify anything in the directory where the program was built, provided {\f1{}make all} has just been done.  This is convenient for building the program under one user name and installing it under another.\par
\par
\pard\li720{}The commands should create all the directories in which files are to be installed, if they don't already exist.  This includes the directories specified as the values of the variables {\f1{}prefix} and {\f1{}exec_prefix}, as well as all subdirectories that are needed.  One way to do this is by means of an {\f1{}installdirs} target as described below.\par
\par
\pard\li720{}Use {\f1{}-} before any command for installing a man page, so that {\f1{}make} will ignore any errors.  This is in case there are systems that don't have the Unix man page documentation system installed.\par
\par
\pard\li720{}The way to install Info files is to copy them into {\f1{}$(infodir)} with {\f1{}$(INSTALL_DATA)} (see {\uldb Command Variables}{\v Command_Variables}), and then run the {\f1{}install-info} program if it is present.  {\f1{}install-info} is a program that edits the Info {\f1{}dir} file to add or update the menu entry for the given Info file; it is part of the Texinfo package.  Here is a sample rule to install an Info file:\par
\par
{\pard\keep\li1440\f1{}$(DESTDIR)$(infodir)/foo.info: foo.info\line
        $(POST_INSTALL)\line
# There may be a newer info file in . than in srcdir.\line
        -if test -f foo.info; then d=.; \'5C\line
         else d=$(srcdir); fi; \'5C\line
        $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \'5C\line
# Run install-info only if it exists.\line
# Use `if' instead of just prepending `-' to the\line
# line so we notice real errors from install-info.\line
# We use `$(SHELL) -c' because some shells do not\line
# fail gracefully when there is an unknown command.\line
        if $(SHELL) -c 'install-info --version' \'5C\line
           >/dev/null 2>&1; then \'5C\line
          install-info --dir-file=$(DESTDIR)$(infodir)/dir \'5C\line
                       $(DESTDIR)$(infodir)/foo.info; \'5C\line
        else true; fi\par
\pard\li720\f0{}}\par
\pard\li720{}When writing the {\f1{}install} target, you must classify all the commands into three categories: normal ones, \'A2pre-installation\'A2 commands and \'A2post-installation\'A2 commands.  See {\uldb Install Command Categories}{\v Install_Command_Categories}.\par
\par
\pard{}{\f1{}uninstall}\par
\pard\li720{}Delete all the installed files--the copies that the {\f1{}install} target creates.\par
\par
\pard\li720{}This rule should not modify the directories where compilation is done, only the directories where files are installed.\par
\par
\pard\li720{}The uninstallation commands are divided into three categories, just like the installation commands.  See {\uldb Install Command Categories}{\v Install_Command_Categories}.\par
\par
\pard{}{\f1{}install-strip}\par
\pard\li720{}Like {\f1{}install}, but strip the executable files while installing them.  In many cases, the definition of this target can be very simple:\par
\par
{\pard\keep\li1440\f1{}install-strip:\line
        $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \'5C\line
                install\par
\pard\li720\f0{}}\par
\pard\li720{}Normally we do not recommend stripping an executable unless you are sure the program has no bugs.  However, it can be reasonable to install a stripped executable for actual execution while saving the unstripped executable elsewhere in case there is a bug.\par
\par
\pard{}{\f1{}clean}\par
\pard\li720{}Delete all files from the current directory that are normally created by building the program.  Don't delete the files that record the configuration.  Also preserve files that could be made by building, but normally aren't because the distribution comes with them.\par
\par
\pard\li720{}Delete {\f1{}.dvi} files here if they are not part of the distribution.\par
\par
\pard{}{\f1{}distclean}\par
\pard\li720{}Delete all files from the current directory that are created by configuring or building the program.  If you have unpacked the source and built the program without creating any other files, {\f1{}make distclean} should leave only the files that were in the distribution.\par
\par
\pard{}{\f1{}mostlyclean}\par
\pard\li720{}Like {\f1{}clean}, but may refrain from deleting a few files that people normally don't want to recompile.  For example, the {\f1{}mostlyclean} target for GCC does not delete {\f1{}libgcc.a}, because recompiling it is rarely necessary and takes a lot of time.\par
\par
\pard{}{\f1{}maintainer-clean}\par
\pard\li720{}Delete almost everything from the current directory that can be reconstructed with this Makefile.  This typically includes everything deleted by {\f1{}distclean}, plus more: C source files produced by Bison, tags tables, Info files, and so on.\par
\par
\pard\li720{}The reason we say "almost everything" is that running the command {\f1{}make maintainer-clean} should not delete {\f1{}configure} even if {\f1{}configure} can be remade using a rule in the Makefile.  More generally, {\f1{}make maintainer-clean} should not delete anything that needs to exist in order to run {\f1{}configure} and then begin to build the program.  This is the only exception; {\f1{}maintainer-clean} should delete everything else that can be rebuilt.\par
\par
\pard\li720{}The {\f1{}maintainer-clean} target is intended to be used by a maintainer of the package, not by ordinary users.  You may need special tools to reconstruct some of the files that {\f1{}make maintainer-clean} deletes.  Since these files are normally included in the distribution, we don't take care to make them easy to reconstruct.  If you find you need to unpack the full distribution again, don't blame us.\par
\par
\pard\li720{}To help make users aware of this, the commands for the special {\f1{}maintainer-clean} target should start with these two:\par
\par
{\pard\keep\li1440\f1{}@echo 'This command is intended for maintainers to use; it'\line
@echo 'deletes files that may need special tools to rebuild.'\par
\pard\li720\f0{}}\par
\pard{}{\f1{}TAGS}\par
\pard\li720{}Update a tags table for this program.\par
\par
\pard{}{\f1{}info}\par
\pard\li720{}Generate any Info files needed.  The best way to write the rules is as follows:\par
\par
{\pard\keep\li1440\f1{}info: foo.info\line
\line
foo.info: foo.texi chap1.texi chap2.texi\line
        $(MAKEINFO) $(srcdir)/foo.texi\par
\pard\li720\f0{}}\par
\pard\li720{}You must define the variable {\f1{}MAKEINFO} in the Makefile.  It should run the {\f1{}makeinfo} program, which is part of the Texinfo distribution.\par
\par
\pard\li720{}Normally a GNU distribution comes with Info files, and that means the Info files are present in the source directory.  Therefore, the Make rule for an info file should update it in the source directory.  When users build the package, ordinarily Make will not update the Info files because they will already be up to date.\par
\par
\pard{}{\f1{}dvi}\par
\pard\li720{}Generate DVI files for all Texinfo documentation.  For example:\par
\par
{\pard\keep\li1440\f1{}dvi: foo.dvi\line
\line
foo.dvi: foo.texi chap1.texi chap2.texi\line
        $(TEXI2DVI) $(srcdir)/foo.texi\par
\pard\li720\f0{}}\par
\pard\li720{}You must define the variable {\f1{}TEXI2DVI} in the Makefile.  It should run the program {\f1{}texi2dvi}, which is part of the Texinfo distribution.({\ul 1}{\v Standard_Targets_1})  Alternatively, write just the dependencies, and allow GNU {\f1{}make} to provide the command.\par
\par
\pard{}{\f1{}dist}\par
\pard\li720{}Create a distribution tar file for this program.  The tar file should be set up so that the file names in the tar file start with a subdirectory name which is the name of the package it is a distribution for.  This name can include the version number.\par
\par
\pard\li720{}For example, the distribution tar file of GCC version 1.40 unpacks into a subdirectory named {\f1{}gcc-1.40}.\par
\par
\pard\li720{}The easiest way to do this is to create a subdirectory appropriately named, use {\f1{}ln} or {\f1{}cp} to install the proper files in it, and then {\f1{}tar} that subdirectory.\par
\par
\pard\li720{}Compress the tar file file with {\f1{}gzip}.  For example, the actual distribution file for GCC version 1.40 is called {\f1{}gcc-1.40.tar.gz}.\par
\par
\pard\li720{}The {\f1{}dist} target should explicitly depend on all non-source files that are in the distribution, to make sure they are up to date in the distribution.  {See {\uldb Making Releases}{\v Releases @standards.hlp}.  }\par
\par
\pard{}{\f1{}check}\par
\pard\li720{}Perform self-tests (if any).  The user must build the program before running the tests, but need not install the program; you should write the self-tests so that they work when the program is built but not installed.\par
\pard{}}\par
\pard{}The following targets are suggested as conventional names, for programs in which they are useful.\par
\par
{\pard{}{\f1{}installcheck}\par
\pard\li720{}Perform installation tests (if any).  The user must build and install the program before running the tests.  You should not assume that {\f1{}$(bindir)} is in the search path.\par
\par
\pard{}{\f1{}installdirs}\par
\pard\li720{}It's useful to add a target named {\f1{}installdirs} to create the directories where files are installed, and their parent directories.  There is a script called {\f1{}mkinstalldirs} which is convenient for this; you can find it in the Texinfo package.  You can use a rule like this:\par
\par
{\pard\keep\li1440\f1{}# Make sure all installation directories (e.g. $(bindir))\line
# actually exist by making them if necessary.\line
installdirs: mkinstalldirs\line
        $(srcdir)/mkinstalldirs $(bindir) $(datadir) \'5C\line
                                $(libdir) $(infodir) \'5C\line
                                $(mandir)\par
\pard\li720\f0{}}\par
\pard\li720{}This rule should not modify the directories where compilation is done.  It should do nothing but create installation directories.\par
\pard{}}\par
\page\pard#{\footnote Standard_Targets_1}
\pard{}(1) {\f1{}texi2dvi} uses TeX to do the real work of formatting. TeX is not distributed with Texinfo.\par
\par
\page\pard Node: {\b Install Command Categories}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Standard Targets}{\v Standard_Targets}, Up: {\uldb Makefile Conventions}{\v Makefile_Conventions}\line
K{\footnote K Install Command Categories}
#{\footnote Install_Command_Categories}
${\footnote \pard{}Install Command Categories}\par
\pard{\fs24\b Install Command Categories}\par
\par
\pard{}{K{\footnote K pre-installation commands}}{K{\footnote K post-installation commands}}When writing the {\f1{}install} target, you must classify all the commands into three categories: normal ones, \'A2pre-installation\'A2 commands and \'A2post-installation\'A2 commands.\par
\par
\pard{}Normal commands move files into their proper places, and set their modes.  They may not alter any files except the ones that come entirely from the package they belong to.\par
\par
\pard{}Pre-installation and post-installation commands may alter other files; in particular, they can edit global configuration files or data bases.\par
\par
\pard{}Pre-installation commands are typically executed before the normal commands, and post-installation commands are typically run after the normal commands.\par
\par
\pard{}The most common use for a post-installation command is to run {\f1{}install-info}.  This cannot be done with a normal command, since it alters a file (the Info directory) which does not come entirely and solely from the package being installed.  It is a post-installation command because it needs to be done after the normal command which installs the package's Info files.\par
\par
\pard{}Most programs don't need any pre-installation commands, but we have the feature just in case it is needed.\par
\par
\pard{}To classify the commands in the {\f1{}install} rule into these three categories, insert \'A2category lines\'A2 among them.  A category line specifies the category for the commands that follow.\par
\par
\pard{}A category line consists of a tab and a reference to a special Make variable, plus an optional comment at the end.  There are three variables you can use, one for each category; the variable name specifies the category.  Category lines are no-ops in ordinary execution because these three Make variables are normally undefined (and you {\i should not} define them in the makefile).\par
\par
\pard{}Here are the three possible category lines, each with a comment that explains what it means:\par
\par
{\pard\keep\li720\f1{}        $(PRE_INSTALL)     # Pre-install commands follow.\line
        $(POST_INSTALL)    # Post-install commands follow.\line
        $(NORMAL_INSTALL)  # Normal commands follow.\par
\pard\f0{}}\par
\pard{}If you don't use a category line at the beginning of the {\f1{}install} rule, all the commands are classified as normal until the first category line.  If you don't use any category lines, all the commands are classified as normal.\par
\par
\pard{}These are the category lines for {\f1{}uninstall}:\par
\par
{\pard\keep\li720\f1{}        $(PRE_UNINSTALL)     # Pre-uninstall commands follow.\line
        $(POST_UNINSTALL)    # Post-uninstall commands follow.\line
        $(NORMAL_UNINSTALL)  # Normal commands follow.\par
\pard\f0{}}\par
\pard{}Typically, a pre-uninstall command would be used for deleting entries from the Info directory.\par
\par
\pard{}If the {\f1{}install} or {\f1{}uninstall} target has any dependencies which act as subroutines of installation, then you should start {\i each} dependency's commands with a category line, and start the main target's commands with a category line also.  This way, you can ensure that each command is placed in the right category regardless of which of the dependencies actually run.\par
\par
\pard{}Pre-installation and post-installation commands should not run any programs except for these:\par
\par
{\pard\keep\li720\f1{}[ basename bash cat chgrp chmod chown cmp cp dd diff echo\line
egrep expand expr false fgrep find getopt grep gunzip gzip\line
hostname install install-info kill ldconfig ln ls md5sum\line
mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee\line
test touch true uname xargs yes\par
\pard\f0{}}\par
\pard{}{K{\footnote K binary packages}}The reason for distinguishing the commands in this way is for the sake of making binary packages.  Typically a binary package contains all the executables and other files that need to be installed, and has its own method of installing them--so it does not need to run the normal installation commands.  But installing the binary package does need to execute the pre-installation and post-installation commands.\par
\par
\pard{}Programs to build binary packages work by extracting the pre-installation and post-installation commands.  Here is one way of extracting the pre-installation commands:\par
\par
{\pard\keep\li720\f1{}make -n install -o all \'5C\line
      PRE_INSTALL=pre-install \'5C\line
      POST_INSTALL=post-install \'5C\line
      NORMAL_INSTALL=normal-install \'5C\line
  | gawk -f pre-install.awk\par
\pard\f0{}}\par
\pard{}where the file {\f1{}pre-install.awk} could contain this:\par
\par
{\pard\keep\li720\f1{}$0 ~ /^\'5Ct[ \'5Ct]*(normal_install|post_install)[ \'5Ct]*$/ \'7Bon = 0\'7D\line
on \'7Bprint $0\'7D\line
$0 ~ /^\'5Ct[ \'5Ct]*pre_install[ \'5Ct]*$/ \'7Bon = 1\'7D\par
\pard\f0{}}\par
\pard{}The resulting file of pre-installation commands is executed as a shell script as part of installing the binary package.\par
\par
\page\pard Node: {\b Quick Reference}, \keepn Next: {\uldb Make Errors}{\v Make_Errors}, Prev: {\uldb Makefile Conventions}{\v Makefile_Conventions}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Quick Reference}
#{\footnote Quick_Reference}
${\footnote \pard{}Quick Reference}\par
\pard{\fs24\b Quick Reference}\par
\par
\pard{}This appendix summarizes the directives, text manipulation functions, and special variables which GNU {\f1{}make} understands.  See {\uldb Special Targets}{\v Special_Targets}, {\uldb Catalogue of Implicit Rules}{\v Catalogue_of_Rules}, and {\uldb Summary of Options}{\v Options_Summary}, for other summaries.\par
\par
\pard{}Here is a summary of the directives GNU {\f1{}make} recognizes:\par
\par
{\pard{}{\f1{}define {\i variable}}\par
\pard{}{\f1{}endef}\par
\pard\li720{}Define a multi-line, recursively-expanded variable.\par
\pard\li720{}See {\uldb Sequences}{\v Sequences}.\par
\par
\pard{}{\f1{}ifdef {\i variable}}\par
\pard{}{\f1{}ifndef {\i variable}}\par
\pard{}{\f1{}ifeq ({\i a},{\i b})}\par
\pard{}{\f1{}ifeq "{\i a}" "{\i b}"}\par
\pard{}{\f1{}ifeq '{\i a}' '{\i b}'}\par
\pard{}{\f1{}ifneq ({\i a},{\i b})}\par
\pard{}{\f1{}ifneq "{\i a}" "{\i b}"}\par
\pard{}{\f1{}ifneq '{\i a}' '{\i b}'}\par
\pard{}{\f1{}else}\par
\pard{}{\f1{}endif}\par
\pard\li720{}Conditionally evaluate part of the makefile.\par
\pard\li720{}See {\uldb Conditionals}{\v Conditionals}.\par
\par
\pard{}{\f1{}include {\i file}}\par
\pard{}{\f1{}-include {\i file}}\par
\pard{}{\f1{}sinclude {\i file}}\par
\pard\li720{}Include another makefile.\par
\pard\li720{}See {\uldb Including Other Makefiles}{\v Include}.\par
\par
\pard{}{\f1{}override {\i variable} = {\i value}}\par
\pard{}{\f1{}override {\i variable} := {\i value}}\par
\pard{}{\f1{}override {\i variable} += {\i value}}\par
\pard{}{\f1{}override {\i variable} ?= {\i value}}\par
\pard{}{\f1{}override define {\i variable}}\par
\pard{}{\f1{}endef}\par
\pard\li720{}Define a variable, overriding any previous definition, even one from the command line.\par
\pard\li720{}See {\uldb The {\f1{}override} Directive}{\v Override_Directive}.\par
\par
\pard{}{\f1{}export}\par
\pard\li720{}Tell {\f1{}make} to export all variables to child processes by default.\par
\pard\li720{}See {\uldb Communicating Variables to a Sub-{\f1{}make}}{\v Variables_Recursion}.\par
\par
\pard{}{\f1{}export {\i variable}}\par
\pard{}{\f1{}export {\i variable} = {\i value}}\par
\pard{}{\f1{}export {\i variable} := {\i value}}\par
\pard{}{\f1{}export {\i variable} += {\i value}}\par
\pard{}{\f1{}export {\i variable} ?= {\i value}}\par
\pard{}{\f1{}unexport {\i variable}}\par
\pard\li720{}Tell {\f1{}make} whether or not to export a particular variable to child processes.\par
\pard\li720{}See {\uldb Communicating Variables to a Sub-{\f1{}make}}{\v Variables_Recursion}.\par
\par
\pard{}{\f1{}vpath {\i pattern} {\i path}}\par
\pard\li720{}Specify a search path for files matching a {\f1{}%} pattern.\par
\pard\li720{}See {\uldb The {\f1{}vpath} Directive}{\v Selective_Search}.\par
\par
\pard{}{\f1{}vpath {\i pattern}}\par
\pard\li720{}Remove all search paths previously specified for {\i pattern}.\par
\par
\pard{}{\f1{}vpath}\par
\pard\li720{}Remove all search paths previously specified in any {\f1{}vpath} directive.\par
\pard{}}\par
\pard{}Here is a summary of the text manipulation functions (see {\uldb Functions}{\v Functions}):\par
\par
{\pard{}{\f1{}$(subst {\i from},{\i to},{\i text})}\par
\pard\li720{}Replace {\i from} with {\i to} in {\i text}.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(patsubst {\i pattern},{\i replacement},{\i text})}\par
\pard\li720{}Replace words matching {\i pattern} with {\i replacement} in {\i text}.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(strip {\i string})}\par
\pard\li720{}Remove excess whitespace characters from {\i string}.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(findstring {\i find},{\i text})}\par
\pard\li720{}Locate {\i find} in {\i text}.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(filter {\i pattern}...,{\i text})}\par
\pard\li720{}Select words in {\i text} that match one of the {\i pattern} words.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(filter-out {\i pattern}...,{\i text})}\par
\pard\li720{}Select words in {\i text} that {\i do not} match any of the {\i pattern} words.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(sort {\i list})}\par
\pard\li720{}Sort the words in {\i list} lexicographically, removing duplicates.\par
\pard\li720{}See {\uldb Functions for String Substitution and Analysis}{\v Text_Functions}.\par
\par
\pard{}{\f1{}$(dir {\i names}...)}\par
\pard\li720{}Extract the directory part of each file name.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(notdir {\i names}...)}\par
\pard\li720{}Extract the non-directory part of each file name.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(suffix {\i names}...)}\par
\pard\li720{}Extract the suffix (the last {\f1{}.} and following characters) of each file name.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(basename {\i names}...)}\par
\pard\li720{}Extract the base name (name without suffix) of each file name.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(addsuffix {\i suffix},{\i names}...)}\par
\pard\li720{}Append {\i suffix} to each word in {\i names}.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(addprefix {\i prefix},{\i names}...)}\par
\pard\li720{}Prepend {\i prefix} to each word in {\i names}.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(join {\i list1},{\i list2})}\par
\pard\li720{}Join two parallel lists of words.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(word {\i n},{\i text})}\par
\pard\li720{}Extract the {\i n}th word (one-origin) of {\i text}.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(words {\i text})}\par
\pard\li720{}Count the number of words in {\i text}.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(wordlist {\i s},{\i e},{\i text})}\par
\pard\li720{}Returns the list of words in {\i text} from {\i s} to {\i e}.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(firstword {\i names}...)}\par
\pard\li720{}Extract the first word of {\i names}.\par
\pard\li720{}See {\uldb Functions for File Names}{\v File_Name_Functions}.\par
\par
\pard{}{\f1{}$(wildcard {\i pattern}...)}\par
\pard\li720{}Find file names matching a shell file name pattern ({\i not} a {\f1{}%} pattern).\par
\pard\li720{}See {\uldb The Function {\f1{}wildcard}}{\v Wildcard_Function}.\par
\par
\pard{}{\f1{}$(error {\i text}...)}\par
\pard\li720{}When this function is evaluated, {\f1{}make} generates a fatal error with the message {\i text}.\par
\pard\li720{}See {\uldb Functions That Control Make}{\v Make_Control_Functions}.\par
\par
\pard{}{\f1{}$(warning {\i text}...)}\par
\pard\li720{}When this function is evaluated, {\f1{}make} generates a warning with the message {\i text}.\par
\pard\li720{}See {\uldb Functions That Control Make}{\v Make_Control_Functions}.\par
\par
\pard{}{\f1{}$(shell {\i command})}\par
\pard\li720{}Execute a shell command and return its output.\par
\pard\li720{}See {\uldb The {\f1{}shell} Function}{\v Shell_Function}.\par
\par
\pard{}{\f1{}$(origin {\i variable})}\par
\pard\li720{}Return a string describing how the {\f1{}make} variable {\i variable} was defined.\par
\pard\li720{}See {\uldb The {\f1{}origin} Function}{\v Origin_Function}.\par
\par
\pard{}{\f1{}$(foreach {\i var},{\i words},{\i text})}\par
\pard\li720{}Evaluate {\i text} with {\i var} bound to each word in {\i words}, and concatenate the results.\par
\pard\li720{}See {\uldb The {\f1{}foreach} Function}{\v Foreach_Function}.\par
\par
\pard{}{\f1{}$(call {\i var},{\i param},...)}\par
\pard\li720{}Evaluate the variable {\i var} replacing any references to {\f1{}$(1)}, {\f1{}$(2)} with the first, second, etc. {\i param} values.\par
\pard\li720{}See {\uldb The {\f1{}call} Function}{\v Call_Function}.\par
\pard{}}\par
\pard{}Here is a summary of the automatic variables.  See {\uldb Automatic Variables}{\v Automatic}, for full information.\par
\par
{\pard{}{\f1{}$@}\par
\pard\li720{}The file name of the target.\par
\par
\pard{}{\f1{}$%}\par
\pard\li720{}The target member name, when the target is an archive member.\par
\par
\pard{}{\f1{}$<}\par
\pard\li720{}The name of the first prerequisite.\par
\par
\pard{}{\f1{}$?}\par
\pard\li720{}The names of all the prerequisites that are newer than the target, with spaces between them.  For prerequisites which are archive members, only the member named is used (see {\uldb Archives}{\v Archives}).\par
\par
\pard{}{\f1{}$^}\par
\pard{}{\f1{}$+}\par
\pard\li720{}The names of all the prerequisites, with spaces between them.  For prerequisites which are archive members, only the member named is used (see {\uldb Archives}{\v Archives}).  The value of {\f1{}$^} omits duplicate prerequisites, while {\f1{}$+} retains them and preserves their order.\par
\par
\pard{}{\f1{}$*}\par
\pard\li720{}The stem with which an implicit rule matches (see {\uldb How Patterns Match}{\v Pattern_Match}).\par
\par
\pard{}{\f1{}$(@D)}\par
\pard{}{\f1{}$(@F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$@}.\par
\par
\pard{}{\f1{}$(*D)}\par
\pard{}{\f1{}$(*F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$*}.\par
\par
\pard{}{\f1{}$(%D)}\par
\pard{}{\f1{}$(%F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$%}.\par
\par
\pard{}{\f1{}$(<D)}\par
\pard{}{\f1{}$(<F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$<}.\par
\par
\pard{}{\f1{}$(^D)}\par
\pard{}{\f1{}$(^F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$^}.\par
\par
\pard{}{\f1{}$(+D)}\par
\pard{}{\f1{}$(+F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$+}.\par
\par
\pard{}{\f1{}$(?D)}\par
\pard{}{\f1{}$(?F)}\par
\pard\li720{}The directory part and the file-within-directory part of {\f1{}$?}.\par
\pard{}}\par
\pard{}These variables are used specially by GNU {\f1{}make}:\par
\par
{\pard{}{\f1{}MAKEFILES}\par
\pard\li720{}Makefiles to be read on every invocation of {\f1{}make}.\par
\pard\li720{}See {\uldb The Variable {\f1{}MAKEFILES}}{\v MAKEFILES_Variable}.\par
\par
\pard{}{\f1{}VPATH}\par
\pard\li720{}Directory search path for files not found in the current directory.\par
\pard\li720{}See {\uldb {\f1{}VPATH} Search Path for All Prerequisites}{\v General_Search}.\par
\par
\pard{}{\f1{}SHELL}\par
\pard\li720{}The name of the system default command interpreter, usually {\f1{}/bin/sh}.  You can set {\f1{}SHELL} in the makefile to change the shell used to run commands.  See {\uldb Command Execution}{\v Execution}.\par
\par
\pard{}{\f1{}MAKESHELL}\par
\pard\li720{}On MS-DOS only, the name of the command interpreter that is to be used by {\f1{}make}. This value takes precedence over the value of {\f1{}SHELL}.  See {\uldb MAKESHELL variable}{\v Execution}.\par
\par
\pard{}{\f1{}MAKE}\par
\pard\li720{}The name with which {\f1{}make} was invoked.  Using this variable in commands has special meaning.  See {\uldb How the {\f1{}MAKE} Variable Works}{\v MAKE_Variable}.\par
\par
\pard{}{\f1{}MAKELEVEL}\par
\pard\li720{}The number of levels of recursion (sub-{\f1{}make}s).\par
\pard\li720{}See {\uldb Variables/Recursion}{\v Variables_Recursion}.\par
\par
\pard{}{\f1{}MAKEFLAGS}\par
\pard\li720{}The flags given to {\f1{}make}.  You can set this in the environment or a makefile to set flags.\par
\pard\li720{}See {\uldb Communicating Options to a Sub-{\f1{}make}}{\v Options_Recursion}.\par
\par
\pard{}{\f1{}MAKECMDGOALS}\par
\pard\li720{}The targets given to {\f1{}make} on the command line.  Setting this variable has no effect on the operation of {\f1{}make}.\par
\pard\li720{}See {\uldb Arguments to Specify the Goals}{\v Goals}.\par
\par
\pard{}{\f1{}CURDIR}\par
\pard\li720{}Set to the pathname of the current working directory (after all {\f1{}-C} options are processed, if any).  Setting this variable has no effect on the operation of {\f1{}make}.\par
\pard\li720{}See {\uldb Recursive Use of {\f1{}make}}{\v Recursion}.\par
\par
\pard{}{\f1{}SUFFIXES}\par
\pard\li720{}The default list of suffixes before {\f1{}make} reads any makefiles.\par
\par
\pard{}{\f1{}.LIBPATTERNS}\par
\pard\li720{}Defines the naming of the libraries {\f1{}make} searches for, and their order.\par
\pard\li720{}See {\uldb Directory Search for Link Libraries}{\v Libraries_Search}.\par
\pard{}}\par
\page\pard Node: {\b Make Errors}, \keepn Next: {\uldb Complex Makefile}{\v Complex_Makefile}, Prev: {\uldb Quick Reference}{\v Quick_Reference}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Make Errors}
#{\footnote Make_Errors}
${\footnote \pard{}Errors Generated by Make}\par
\pard{\fs24\b Errors Generated by Make}\par
\par
\pard{}Here is a list of the most common errors you might see generated by {\f1{}make}, and some information about what they mean and how to fix them.\par
\par
\pard{}Sometimes {\f1{}make} errors are not fatal, especially in the presence of a {\f1{}-} prefix on a command script line, or the {\f1{}-k} command line option.  Errors that are fatal are prefixed with the string {\f1{}***}.\par
\par
\pard{}Error messages are all either prefixed with the name of the program (usually {\f1{}make}), or, if the error is found in a makefile, the name of the file and linenumber containing the problem.\par
\par
\pard{}In the table below, these common prefixes are left off.\par
\par
{\pard{}{\f1{}[{\i foo}] Error {\i NN}}\par
\pard{}{\f1{}[{\i foo}] {\i signal description}}\par
\pard\li720{}These errors are not really {\f1{}make} errors at all.  They mean that a program that {\f1{}make} invoked as part of a command script returned a non-0 error code ({\f1{}Error {\i NN}}), which {\f1{}make} interprets as failure, or it exited in some other abnormal fashion (with a signal of some type).  See {\uldb Errors in Commands}{\v Errors}.\par
\par
\pard\li720{}If no {\f1{}***} is attached to the message, then the subprocess failed but the rule in the makefile was prefixed with the {\f1{}-} special character, so {\f1{}make} ignored the error.\par
\par
\pard{}{\f1{}missing separator.  Stop.}\par
\pard{}{\f1{}missing separator (did you mean TAB instead of 8 spaces?).  Stop.}\par
\pard\li720{}This means that {\f1{}make} could not understand much of anything about the command line it just read.  GNU {\f1{}make} looks for various kinds of separators ({\f1{}:}, {\f1{}=}, TAB characters, etc.) to help it decide what kind of commandline it's seeing.  This means it couldn't find a valid one.\par
\par
\pard\li720{}One of the most common reasons for this message is that you (or perhaps your oh-so-helpful editor, as is the case with many MS-Windows editors) have attempted to indent your command scripts with spaces instead of a TAB character.  In this case, {\f1{}make} will use the second form of the error above.  Remember that every line in the command script must begin with a TAB character.  Eight spaces do not count.  See {\uldb Rule Syntax}{\v Rule_Syntax}.\par
\par
\pard{}{\f1{}commands commence before first target.  Stop.}\par
\pard{}{\f1{}missing rule before commands.  Stop.}\par
\pard\li720{}This means the first thing in the makefile seems to be part of a command script: it begins with a TAB character and doesn't appear to be a legal {\f1{}make} command (such as a variable assignment).  Command scripts must always be associated with a target.\par
\par
\pard\li720{}The second form is generated if the line has a semicolon as the first non-whitespace character; {\f1{}make} interprets this to mean you left out the "target: prerequisite" section of a rule.  See {\uldb Rule Syntax}{\v Rule_Syntax}.\par
\par
\pard{}{\f1{}No rule to make target `{\i xxx}'.}\par
\pard{}{\f1{}No rule to make target `{\i xxx}', needed by `{\i yyy}'.}\par
\pard\li720{}This means that {\f1{}make} decided it needed to build a target, but then couldn't find any instructions in the makefile on how to do that, either explicit or implicit (including in the default rules database).\par
\par
\pard\li720{}If you want that file to be built, you will need to add a rule to your makefile describing how that target can be built.  Other possible sources of this problem are typos in the makefile (if that filename is wrong) or a corrupted source tree (if that file is not supposed to be built, but rather only a prerequisite).\par
\par
\pard{}{\f1{}No targets specified and no makefile found.  Stop.}\par
\pard{}{\f1{}No targets.  Stop.}\par
\pard\li720{}The former means that you didn't provide any targets to be built on the command line, and {\f1{}make} couldn't find any makefiles to read in.  The latter means that some makefile was found, but it didn't contain any default target and none was given on the command line.  GNU {\f1{}make} has nothing to do in these situations.  See {\uldb Arguments to Specify the Makefile}{\v Makefile_Arguments}.\par
\par
\pard{}{\f1{}Makefile `{\i xxx}' was not found.}\par
\pard{}{\f1{}Included makefile `{\i xxx}' was not found.}\par
\pard\li720{}A makefile specified on the command line (first form) or included (second form) was not found.\par
\par
\pard{}{\f1{}warning: overriding commands for target `{\i xxx}'}\par
\pard{}{\f1{}warning: ignoring old commands for target `{\i xxx}'}\par
\pard\li720{}GNU {\f1{}make} allows commands to be specified only once per target (except for double-colon rules).  If you give commands for a target which already has been defined to have commands, this warning is issued and the second set of commands will overwrite the first set.  See {\uldb Multiple Rules for One Target}{\v Multiple_Rules}.\par
\par
\pard{}{\f1{}Circular {\i xxx} <- {\i yyy} dependency dropped.}\par
\pard\li720{}This means that {\f1{}make} detected a loop in the dependency graph: after tracing the prerequisite {\i yyy} of target {\i xxx}, and its prerequisites, etc., one of them depended on {\i xxx} again.\par
\par
\pard{}{\f1{}Recursive variable `{\i xxx}' references itself (eventually).  Stop.}\par
\pard\li720{}This means you've defined a normal (recursive) {\f1{}make} variable {\i xxx} that, when it's expanded, will refer to itself ({\i xxx}).  This is not allowed; either use simply-expanded variables ({\f1{}:=}) or use the append operator ({\f1{}+=}).  See {\uldb How to Use Variables}{\v Using_Variables}.\par
\par
\pard{}{\f1{}Unterminated variable reference.  Stop.}\par
\pard\li720{}This means you forgot to provide the proper closing parenthesis or brace in your variable or function reference.\par
\par
\pard{}{\f1{}insufficient arguments to function `{\i xxx}'.  Stop.}\par
\pard\li720{}This means you haven't provided the requisite number of arguments for this function.  See the documentation of the function for a description of its arguments.  See {\uldb Functions for Transforming Text}{\v Functions}.\par
\par
\pard{}{\f1{}missing target pattern.  Stop.}\par
\pard{}{\f1{}multiple target patterns.  Stop.}\par
\pard{}{\f1{}target pattern contains no `%'.  Stop.}\par
\pard\li720{}These are generated for malformed static pattern rules.  The first means there's no pattern in the target section of the rule, the second means there are multiple patterns in the target section, and the third means the target doesn't contain a pattern character ({\f1{}%}).  See {\uldb Syntax of Static Pattern Rules}{\v Static_Usage}.\par
\par
\pard{}{\f1{}warning: -jN forced in submake: disabling jobserver mode.}\par
\pard\li720{}This warning and the next are generated if {\f1{}make} detects error conditions related to parallel processing on systems where sub-{\f1{}make}s can communicate (see {\uldb \'5Cline}{\v Options_Recursion}).  This warning is generated if a recursive invocation of a {\f1{}make} process is forced to have {\f1{}-j{\i N}} in its argument list (where {\i N} is greater than one).  This could happen, for example, if you set the {\f1{}MAKE} environment variable to {\f1{}make -j2}.  In this case, the sub-{\f1{}make} doesn't communicate with other {\f1{}make} processes and will simply pretend it has two jobs of its own.\par
\par
\pard{}{\f1{}warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.}\par
\pard\li720{}In order for {\f1{}make} processes to communicate, the parent will pass information to the child.  Since this could result in problems if the child process isn't actually a {\f1{}make}, the parent will only do this if it thinks the child is a {\f1{}make}.  The parent uses the normal algorithms to determine this (see {\uldb How the {\f1{}MAKE} Variable Works}{\v MAKE_Variable}).  If the makefile is constructed such that the parent doesn't know the child is a {\f1{}make} process, then the child will receive only part of the information necessary.  In this case, the child will generate this warning message and proceed with its build in a sequential manner.\par
\par
\pard{}}\par
\page\pard Node: {\b Complex Makefile}, \keepn Next: {\uldb Concept Index}{\v Concept_Index}, Prev: {\uldb Make Errors}{\v Make_Errors}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Complex Makefile}
#{\footnote Complex_Makefile}
${\footnote \pard{}Complex Makefile Example}\par
\pard{\fs24\b Complex Makefile Example}\par
\par
\pard{}Here is the makefile for the GNU {\f1{}tar} program.  This is a moderately complex makefile.\par
\par
\pard{}Because it is the first target, the default goal is {\f1{}all}.  An interesting feature of this makefile is that {\f1{}testpad.h} is a source file automatically created by the {\f1{}testpad} program, itself compiled from {\f1{}testpad.c}.\par
\par
\pard{}If you type {\f1{}make} or {\f1{}make all}, then {\f1{}make} creates the {\f1{}tar} executable, the {\f1{}rmt} daemon that provides remote tape access, and the {\f1{}tar.info} Info file.\par
\par
\pard{}If you type {\f1{}make install}, then {\f1{}make} not only creates {\f1{}tar}, {\f1{}rmt}, and {\f1{}tar.info}, but also installs them.\par
\par
\pard{}If you type {\f1{}make clean}, then {\f1{}make} removes the {\f1{}.o} files, and the {\f1{}tar}, {\f1{}rmt}, {\f1{}testpad}, {\f1{}testpad.h}, and {\f1{}core} files.\par
\par
\pard{}If you type {\f1{}make distclean}, then {\f1{}make} not only removes the same files as does {\f1{}make clean} but also the {\f1{}TAGS}, {\f1{}Makefile}, and {\f1{}config.status} files.  (Although it is not evident, this makefile (and {\f1{}config.status}) is generated by the user with the {\f1{}configure} program, which is provided in the {\f1{}tar} distribution, but is not shown here.)\par
\par
\pard{}If you type {\f1{}make realclean}, then {\f1{}make} removes the same files as does {\f1{}make distclean} and also removes the Info files generated from {\f1{}tar.texinfo}.\par
\par
\pard{}In addition, there are targets {\f1{}shar} and {\f1{}dist} that create distribution kits.\par
\par
{{\pard\keep\li720\f1{}# Generated automatically from Makefile.in by configure.\line
# Un*x Makefile for GNU tar program.\line
# Copyright (C) 1991 Free Software Foundation, Inc.\par
\pard\keep\li720{}}\line
{# This program is free software; you can redistribute\line
# it and/or modify it under the terms of the GNU\line
# General Public License ...\line
...\line
...\par
\pard\keep\li720{}}\line
SHELL = /bin/sh\line
\line
#### Start of system configuration section. ####\line
\line
srcdir = .\line
\line
{# If you use gcc, you should either run the\line
# fixincludes script that comes with it or else use\line
# gcc with the -traditional option.  Otherwise ioctl\line
# calls will be compiled incorrectly on some systems.\line
CC = gcc -O\line
YACC = bison -y\line
INSTALL = /usr/local/bin/install -c\line
INSTALLDATA = /usr/local/bin/install -c -m 644\par
\pard\keep\li720{}}\line
# Things you might add to DEFS:\line
# -DSTDC_HEADERS        If you have ANSI C headers and\line
#                       libraries.\line
# -DPOSIX               If you have POSIX.1 headers and\line
#                       libraries.\line
# -DBSD42               If you have sys/dir.h (unless\line
#                       you use -DPOSIX), sys/file.h,\line
#                       and st_blocks in `struct stat'.\line
# -DUSG                 If you have System V/ANSI C\line
#                       string and memory functions\line
#                       and headers, sys/sysmacros.h,\line
#                       fcntl.h, getcwd, no valloc,\line
#                       and ndir.h (unless\line
#                       you use -DDIRENT).\line
# -DNO_MEMORY_H         If USG or STDC_HEADERS but do not\line
#                       include memory.h.\line
# -DDIRENT              If USG and you have dirent.h\line
#                       instead of ndir.h.\line
# -DSIGTYPE=int         If your signal handlers\line
#                       return int, not void.\line
# -DNO_MTIO             If you lack sys/mtio.h\line
#                       (magtape ioctls).\line
# -DNO_REMOTE           If you do not have a remote shell\line
#                       or rexec.\line
# -DUSE_REXEC           To use rexec for remote tape\line
#                       operations instead of\line
#                       forking rsh or remsh.\line
# -DVPRINTF_MISSING     If you lack vprintf function\line
#                       (but have _doprnt).\line
# -DDOPRNT_MISSING      If you lack _doprnt function.\line
#                       Also need to define\line
#                       -DVPRINTF_MISSING.\line
# -DFTIME_MISSING       If you lack ftime system call.\line
# -DSTRSTR_MISSING      If you lack strstr function.\line
# -DVALLOC_MISSING      If you lack valloc function.\line
# -DMKDIR_MISSING       If you lack mkdir and\line
#                       rmdir system calls.\line
# -DRENAME_MISSING      If you lack rename system call.\line
# -DFTRUNCATE_MISSING   If you lack ftruncate\line
#                       system call.\line
# -DV7                  On Version 7 Unix (not\line
#                       tested in a long time).\line
# -DEMUL_OPEN3          If you lack a 3-argument version\line
#                       of open, and want to emulate it\line
#                       with system calls you do have.\line
# -DNO_OPEN3            If you lack the 3-argument open\line
#                       and want to disable the tar -k\line
#                       option instead of emulating open.\line
# -DXENIX               If you have sys/inode.h\line
#                       and need it 94 to be included.\line
\line
DEFS =  -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \'5C\line
        -DVPRINTF_MISSING -DBSD42\line
# Set this to rtapelib.o unless you defined NO_REMOTE,\line
# in which case make it empty.\line
RTAPELIB = rtapelib.o\line
LIBS =\line
DEF_AR_FILE = /dev/rmt8\line
DEFBLOCKING = 20\line
\line
{CDEBUG = -g\line
CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \'5C\line
        -DDEF_AR_FILE=\'5C"$(DEF_AR_FILE)\'5C" \'5C\line
        -DDEFBLOCKING=$(DEFBLOCKING)\line
LDFLAGS = -g\par
\pard\keep\li720{}}\line
{prefix = /usr/local\line
# Prefix for each installed program,\line
# normally empty or `g'.\line
binprefix =\line
\line
# The directory to install tar in.\line
bindir = $(prefix)/bin\line
\line
# The directory to install the info files in.\line
infodir = $(prefix)/info\par
\pard\keep\li720{}}\line
#### End of system configuration section. ####\line
\line
SRC1 =  tar.c create.c extract.c buffer.c \'5C\line
        getoldopt.c update.c gnu.c mangle.c\line
SRC2 =  version.c list.c names.c diffarch.c \'5C\line
        port.c wildmat.c getopt.c\line
SRC3 =  getopt1.c regex.c getdate.y\line
SRCS =  $(SRC1) $(SRC2) $(SRC3)\line
OBJ1 =  tar.o create.o extract.o buffer.o \'5C\line
        getoldopt.o update.o gnu.o mangle.o\line
OBJ2 =  version.o list.o names.o diffarch.o \'5C\line
        port.o wildmat.o getopt.o\line
OBJ3 =  getopt1.o regex.o getdate.o $(RTAPELIB)\line
OBJS =  $(OBJ1) $(OBJ2) $(OBJ3)\line
{AUX =   README COPYING ChangeLog Makefile.in  \'5C\line
        makefile.pc configure configure.in \'5C\line
        tar.texinfo tar.info* texinfo.tex \'5C\line
        tar.h port.h open3.h getopt.h regex.h \'5C\line
        rmt.h rmt.c rtapelib.c alloca.c \'5C\line
        msd_dir.h msd_dir.c tcexparg.c \'5C\line
        level-0 level-1 backup-specs testpad.c\par
\pard\keep\li720{}}\line
all:    tar rmt tar.info\line
\line
{tar:    $(OBJS)\line
        $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)\par
\pard\keep\li720{}}\line
{rmt:    rmt.c\line
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c\par
\pard\keep\li720{}}\line
{tar.info: tar.texinfo\line
        makeinfo tar.texinfo\par
\pard\keep\li720{}}\line
{install: all\line
        $(INSTALL) tar $(bindir)/$(binprefix)tar\line
        -test ! -f rmt || $(INSTALL) rmt /etc/rmt\line
        $(INSTALLDATA) $(srcdir)/tar.info* $(infodir)\par
\pard\keep\li720{}}\line
{$(OBJS): tar.h port.h testpad.h\line
regex.o buffer.o tar.o: regex.h\line
# getdate.y has 8 shift/reduce conflicts.\par
\pard\keep\li720{}}\line
{testpad.h: testpad\line
        ./testpad\par
\pard\keep\li720{}}\line
{testpad: testpad.o\line
        $(CC) -o $@ testpad.o\par
\pard\keep\li720{}}\line
{TAGS:   $(SRCS)\line
        etags $(SRCS)\par
\pard\keep\li720{}}\line
{clean:\line
        rm -f *.o tar rmt testpad testpad.h core\par
\pard\keep\li720{}}\line
{distclean: clean\line
        rm -f TAGS Makefile config.status\par
\pard\keep\li720{}}\line
{realclean: distclean\line
        rm -f tar.info*\par
\pard\keep\li720{}}\line
{shar: $(SRCS) $(AUX)\line
        shar $(SRCS) $(AUX) | compress \'5C\line
          > tar-`sed -e '/version_string/!d' \'5C\line
                     -e 's/[^0-9.]*\'5C([0-9.]*\'5C).*/\'5C1/' \'5C\line
                     -e q\line
                     version.c`.shar.Z\par
\pard\keep\li720{}}\line
{dist: $(SRCS) $(AUX)\line
        echo tar-`sed \'5C\line
             -e '/version_string/!d' \'5C\line
             -e 's/[^0-9.]*\'5C([0-9.]*\'5C).*/\'5C1/' \'5C\line
             -e q\line
             version.c` > .fname\line
        -rm -rf `cat .fname`\line
        mkdir `cat .fname`\line
        ln $(SRCS) $(AUX) `cat .fname`\line
        tar chZf `cat .fname`.tar.Z `cat .fname`\line
        -rm -rf `cat .fname` .fname\par
\pard\keep\li720{}}\line
{tar.zoo: $(SRCS) $(AUX)\line
        -rm -rf tmp.dir\line
        -mkdir tmp.dir\line
        -rm tar.zoo\line
        for X in $(SRCS) $(AUX) ; do \'5C\line
            echo $$X ; \'5C\line
            sed 's/$$/^M/' $$X \'5C\line
            > tmp.dir/$$X ; done\line
        cd tmp.dir ; zoo aM ../tar.zoo *\line
        -rm -rf tmp.dir\par
\pard\keep\li720{}}}\par
\page\pard Node: {\b Concept Index}, \keepn Next: {\uldb Name Index}{\v Name_Index}, Prev: {\uldb Complex Makefile}{\v Complex_Makefile}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Concept Index}
#{\footnote Concept_Index}
${\footnote \pard\f0{}Index of Concepts}\par
\pard{\fs24\b Index of Concepts}\par
\par
{\fi-2880\li2880\tx2880+, and {\f1{}define}:\tab {\uldb Sequences}{\v Sequences}.\par}{\fi-2880\li2880\tx2880+=:\tab {\uldb Appending}{\v Appending}.\par}{\fi-2880\li2880\tx2880+=, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880,v (RCS file extension):\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880-, and {\f1{}define}:\tab {\uldb Sequences}{\v Sequences}.\par}{\fi-2880\li2880\tx2880.c:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.C:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.cc:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.ch:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.def:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.dvi:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.F:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.f:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.info:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.l:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.ln:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.mod:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.o:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.p:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.r:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.S:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.s:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.sh:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.sym:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.tex:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.texi:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.texinfo:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.txinfo:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.w:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.web:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880.y:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880:= <1>:\tab {\uldb Setting}{\v Setting}.\par}{\fi-2880\li2880\tx2880:=:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880= <1>:\tab {\uldb Setting}{\v Setting}.\par}{\fi-2880\li2880\tx2880=:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880=, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880?= <1>:\tab {\uldb Setting}{\v Setting}.\par}{\fi-2880\li2880\tx2880?=:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880?=, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880@, and {\f1{}define}:\tab {\uldb Sequences}{\v Sequences}.\par}{\fi-2880\li2880\tx2880algorithm for directory search:\tab {\uldb Search Algorithm}{\v Search_Algorithm}.\par}{\fi-2880\li2880\tx2880appending to variables:\tab {\uldb Appending}{\v Appending}.\par}{\fi-2880\li2880\tx2880ar:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880archive:\tab {\uldb Archives}{\v Archives}.\par}{\fi-2880\li2880\tx2880archive member targets:\tab {\uldb Archive Members}{\v Archive_Members}.\par}{\fi-2880\li2880\tx2880archive symbol directory updating:\tab {\uldb Archive Symbols}{\v Archive_Symbols}.\par}{\fi-2880\li2880\tx2880archive, and parallel execution:\tab {\uldb Archive Pitfalls}{\v Archive_Pitfalls}.\par}{\fi-2880\li2880\tx2880archive, and {\f1{}-j}:\tab {\uldb Archive Pitfalls}{\v Archive_Pitfalls}.\par}{\fi-2880\li2880\tx2880archive, suffix rule for:\tab {\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}.\par}{\fi-2880\li2880\tx2880Arg list too long:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880arguments of functions:\tab {\uldb Syntax of Functions}{\v Syntax_of_Functions}.\par}{\fi-2880\li2880\tx2880as <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880as:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880assembly, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880automatic generation of prerequisites <1>:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880automatic generation of prerequisites:\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880automatic variables:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880backquotes:\tab {\uldb Shell Function}{\v Shell_Function}.\par}{\fi-2880\li2880\tx2880backslash ({\f1{}\'5C}), for continuation lines:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880backslash ({\f1{}\'5C}), in commands:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880backslash ({\f1{}\'5C}), to quote {\f1{}%} <1>:\tab {\uldb Selective Search}{\v Selective_Search}.\par}{\fi-2880\li2880\tx2880backslash ({\f1{}\'5C}), to quote {\f1{}%} <2>:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880backslash ({\f1{}\'5C}), to quote {\f1{}%}:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880backslashes in pathnames and wildcard expansion:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880basename:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880binary packages:\tab {\uldb Install Command Categories}{\v Install_Command_Categories}.\par}{\fi-2880\li2880\tx2880broken pipe:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880bugs, reporting:\tab {\uldb Bugs}{\v Bugs}.\par}{\fi-2880\li2880\tx2880built-in special targets:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880C++, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880C, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880cc <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880cc:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880chains of rules:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880cleaning up:\tab {\uldb Cleanup}{\v Cleanup}.\par}{\fi-2880\li2880\tx2880co <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880co:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880combining rules by prerequisite:\tab {\uldb Combine By Prerequisite}{\v Combine_By_Prerequisite}.\par}{\fi-2880\li2880\tx2880command line variable definitions, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880command line variables:\tab {\uldb Overriding}{\v Overriding}.\par}{\fi-2880\li2880\tx2880commands:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880commands, backslash ({\f1{}\'5C}) in:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880commands, comments in:\tab {\uldb Commands}{\v Commands}.\par}{\fi-2880\li2880\tx2880commands, echoing:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880commands, empty:\tab {\uldb Empty Commands}{\v Empty_Commands}.\par}{\fi-2880\li2880\tx2880commands, errors in:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880commands, execution:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880commands, execution in parallel:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880commands, expansion:\tab {\uldb Shell Function}{\v Shell_Function}.\par}{\fi-2880\li2880\tx2880commands, how to write:\tab {\uldb Commands}{\v Commands}.\par}{\fi-2880\li2880\tx2880commands, instead of executing:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880commands, introduction to:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880commands, quoting newlines in:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880commands, sequences of:\tab {\uldb Sequences}{\v Sequences}.\par}{\fi-2880\li2880\tx2880comments, in commands:\tab {\uldb Commands}{\v Commands}.\par}{\fi-2880\li2880\tx2880comments, in makefile:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880compatibility:\tab {\uldb Features}{\v Features}.\par}{\fi-2880\li2880\tx2880compatibility in exporting:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880compilation, testing:\tab {\uldb Testing}{\v Testing}.\par}{\fi-2880\li2880\tx2880computed variable name:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880conditional expansion:\tab {\uldb If Function}{\v If_Function}.\par}{\fi-2880\li2880\tx2880conditional variable assignment:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880conditionals:\tab {\uldb Conditionals}{\v Conditionals}.\par}{\fi-2880\li2880\tx2880continuation lines:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880controlling make:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880conventions for makefiles:\tab {\uldb Makefile Conventions}{\v Makefile_Conventions}.\par}{\fi-2880\li2880\tx2880ctangle <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880ctangle:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880cweave <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880cweave:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880deducing commands (implicit rules):\tab {\uldb make Deduces}{\v make_Deduces}.\par}{\fi-2880\li2880\tx2880default directries for included makefiles:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880default goal <1>:\tab {\uldb Rules}{\v Rules}.\par}{\fi-2880\li2880\tx2880default goal:\tab {\uldb How Make Works}{\v How_Make_Works}.\par}{\fi-2880\li2880\tx2880default makefile name:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880default rules, last-resort:\tab {\uldb Last Resort}{\v Last_Resort}.\par}{\fi-2880\li2880\tx2880define, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880defining variables verbatim:\tab {\uldb Defining}{\v Defining}.\par}{\fi-2880\li2880\tx2880deletion of target files <1>:\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880deletion of target files:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880directive:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880directories, printing them:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880directories, updating archive symbol:\tab {\uldb Archive Symbols}{\v Archive_Symbols}.\par}{\fi-2880\li2880\tx2880directory part:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880directory search ({\f1{}VPATH}):\tab {\uldb Directory Search}{\v Directory_Search}.\par}{\fi-2880\li2880\tx2880directory search ({\f1{}VPATH}), and implicit rules:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880directory search ({\f1{}VPATH}), and link libraries:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880directory search ({\f1{}VPATH}), and shell commands:\tab {\uldb Commands/Search}{\v Commands_Search}.\par}{\fi-2880\li2880\tx2880directory search algorithm:\tab {\uldb Search Algorithm}{\v Search_Algorithm}.\par}{\fi-2880\li2880\tx2880directory search, traditional:\tab {\uldb Search Algorithm}{\v Search_Algorithm}.\par}{\fi-2880\li2880\tx2880dollar sign ({\f1{}$}), in function call:\tab {\uldb Syntax of Functions}{\v Syntax_of_Functions}.\par}{\fi-2880\li2880\tx2880dollar sign ({\f1{}$}), in rules:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880dollar sign ({\f1{}$}), in variable name:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880dollar sign ({\f1{}$}), in variable reference:\tab {\uldb Reference}{\v Reference}.\par}{\fi-2880\li2880\tx2880double-colon rules:\tab {\uldb Double-Colon}{\v Double_Colon}.\par}{\fi-2880\li2880\tx2880duplicate words, removing:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880E2BIG:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880echoing of commands:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880editor:\tab {\uldb Introduction}{\v Introduction}.\par}{\fi-2880\li2880\tx2880Emacs ({\f1{}M-x compile}):\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880empty commands:\tab {\uldb Empty Commands}{\v Empty_Commands}.\par}{\fi-2880\li2880\tx2880empty targets:\tab {\uldb Empty Targets}{\v Empty_Targets}.\par}{\fi-2880\li2880\tx2880environment:\tab {\uldb Environment}{\v Environment}.\par}{\fi-2880\li2880\tx2880environment, and recursion:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880environment, {\f1{}SHELL} in:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880error, stopping on:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880errors (in commands):\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880errors with wildcards:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880execution, in parallel:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880execution, instead of:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880execution, of commands:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880exit status (errors):\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880explicit rule, definition of:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880explicit rule, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880exporting variables:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880f77 <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880f77:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880features of GNU {\f1{}make}:\tab {\uldb Features}{\v Features}.\par}{\fi-2880\li2880\tx2880features, missing:\tab {\uldb Missing}{\v Missing}.\par}{\fi-2880\li2880\tx2880file name functions:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880file name of makefile:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880file name of makefile, how to specify:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880file name prefix, adding:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880file name suffix:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880file name suffix, adding:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880file name with wildcards:\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880file name, basename of:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880file name, directory part:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880file name, nondirectory part:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880files, assuming new:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880files, assuming old:\tab {\uldb Avoiding Compilation}{\v Avoiding_Compilation}.\par}{\fi-2880\li2880\tx2880files, avoiding recompilation of:\tab {\uldb Avoiding Compilation}{\v Avoiding_Compilation}.\par}{\fi-2880\li2880\tx2880files, intermediate:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880filtering out words:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880filtering words:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880finding strings:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880flags:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880flags for compilers:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880flavors of variables:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880force targets:\tab {\uldb Force Targets}{\v Force_Targets}.\par}{\fi-2880\li2880\tx2880Fortran, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880functions:\tab {\uldb Functions}{\v Functions}.\par}{\fi-2880\li2880\tx2880functions, for controlling make:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880functions, for file names:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880functions, for text:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880functions, syntax of:\tab {\uldb Syntax of Functions}{\v Syntax_of_Functions}.\par}{\fi-2880\li2880\tx2880functions, user defined:\tab {\uldb Call Function}{\v Call_Function}.\par}{\fi-2880\li2880\tx2880g++ <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880g++:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880gcc:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880generating prerequisites automatically <1>:\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880generating prerequisites automatically:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880get <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880get:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880globbing (wildcards):\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880goal:\tab {\uldb How Make Works}{\v How_Make_Works}.\par}{\fi-2880\li2880\tx2880goal, default <1>:\tab {\uldb Rules}{\v Rules}.\par}{\fi-2880\li2880\tx2880goal, default:\tab {\uldb How Make Works}{\v How_Make_Works}.\par}{\fi-2880\li2880\tx2880goal, how to specify:\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880home directory:\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880IEEE Standard 1003.2:\tab {\uldb Overview}{\v Overview}.\par}{\fi-2880\li2880\tx2880ifdef, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880ifeq, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880ifndef, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880ifneq, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880implicit rule:\tab {\uldb Implicit Rules}{\v Implicit_Rules}.\par}{\fi-2880\li2880\tx2880implicit rule, and directory search:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880implicit rule, and {\f1{}VPATH}:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880implicit rule, definition of:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880implicit rule, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880implicit rule, how to use:\tab {\uldb Using Implicit}{\v Using_Implicit}.\par}{\fi-2880\li2880\tx2880implicit rule, introduction to:\tab {\uldb make Deduces}{\v make_Deduces}.\par}{\fi-2880\li2880\tx2880implicit rule, predefined:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880implicit rule, search algorithm:\tab {\uldb Implicit Rule Search}{\v Implicit_Rule_Search}.\par}{\fi-2880\li2880\tx2880included makefiles, default directries:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880including ({\f1{}MAKEFILES} variable):\tab {\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}.\par}{\fi-2880\li2880\tx2880including other makefiles:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880incompatibilities:\tab {\uldb Missing}{\v Missing}.\par}{\fi-2880\li2880\tx2880Info, rule to format:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880intermediate files:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880intermediate files, preserving:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880intermediate targets, explicit:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880interrupt:\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880job slots:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880job slots, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880jobs, limiting based on load:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880joining lists of words:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880killing (interruption):\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880last-resort default rules:\tab {\uldb Last Resort}{\v Last_Resort}.\par}{\fi-2880\li2880\tx2880ld:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880lex <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880lex:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880Lex, rule to run:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880libraries for linking, directory search:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880library archive, suffix rule for:\tab {\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}.\par}{\fi-2880\li2880\tx2880limiting jobs based on load:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880link libraries, and directory search:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880link libraries, patterns matching:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880linking, predefined rule for:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880lint:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880list of all prerequisites:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880list of changed prerequisites:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880load average:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880loops in variable expansion:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880m2c:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880macro:\tab {\uldb Using Variables}{\v Using_Variables}.\par}{\fi-2880\li2880\tx2880makefile:\tab {\uldb Introduction}{\v Introduction}.\par}{\fi-2880\li2880\tx2880makefile name:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880makefile name, how to specify:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880makefile rule parts:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880makefile, and {\f1{}MAKEFILES} variable:\tab {\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}.\par}{\fi-2880\li2880\tx2880makefile, conventions for:\tab {\uldb Makefile Conventions}{\v Makefile_Conventions}.\par}{\fi-2880\li2880\tx2880makefile, how to write:\tab {\uldb Makefiles}{\v Makefiles}.\par}{\fi-2880\li2880\tx2880makefile, how {\f1{}make} processes:\tab {\uldb How Make Works}{\v How_Make_Works}.\par}{\fi-2880\li2880\tx2880makefile, including:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880makefile, overriding:\tab {\uldb Overriding Makefiles}{\v Overriding_Makefiles}.\par}{\fi-2880\li2880\tx2880makefile, parsing:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880makefile, remaking of:\tab {\uldb Remaking Makefiles}{\v Remaking_Makefiles}.\par}{\fi-2880\li2880\tx2880makefile, simple:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880makeinfo <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880makeinfo:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880match-anything rule:\tab {\uldb Match-Anything Rules}{\v Match_Anything_Rules}.\par}{\fi-2880\li2880\tx2880match-anything rule, used to override:\tab {\uldb Overriding Makefiles}{\v Overriding_Makefiles}.\par}{\fi-2880\li2880\tx2880missing features:\tab {\uldb Missing}{\v Missing}.\par}{\fi-2880\li2880\tx2880mistakes with wildcards:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880modified variable reference:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880Modula-2, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880multiple rules for one target:\tab {\uldb Multiple Rules}{\v Multiple_Rules}.\par}{\fi-2880\li2880\tx2880multiple rules for one target ({\f1{}::}):\tab {\uldb Double-Colon}{\v Double_Colon}.\par}{\fi-2880\li2880\tx2880multiple targets:\tab {\uldb Multiple Targets}{\v Multiple_Targets}.\par}{\fi-2880\li2880\tx2880multiple targets, in pattern rule:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880name of makefile:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880name of makefile, how to specify:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880nested variable reference:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880newline, quoting, in commands:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880newline, quoting, in makefile:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880nondirectory part:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880old-fashioned suffix rules:\tab {\uldb Suffix Rules}{\v Suffix_Rules}.\par}{\fi-2880\li2880\tx2880options:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880options, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880options, setting from environment:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880options, setting in makefiles:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880order of pattern rules:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880origin of variable:\tab {\uldb Origin Function}{\v Origin_Function}.\par}{\fi-2880\li2880\tx2880overriding makefiles:\tab {\uldb Overriding Makefiles}{\v Overriding_Makefiles}.\par}{\fi-2880\li2880\tx2880overriding variables with arguments:\tab {\uldb Overriding}{\v Overriding}.\par}{\fi-2880\li2880\tx2880overriding with {\f1{}override}:\tab {\uldb Override Directive}{\v Override_Directive}.\par}{\fi-2880\li2880\tx2880parallel execution:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880parallel execution, and archive update:\tab {\uldb Archive Pitfalls}{\v Archive_Pitfalls}.\par}{\fi-2880\li2880\tx2880parts of makefile rule:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880Pascal, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880pattern rule:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880pattern rule, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880pattern rules, order of:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880pattern rules, static (not implicit):\tab {\uldb Static Pattern}{\v Static_Pattern}.\par}{\fi-2880\li2880\tx2880pattern rules, static, syntax of:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880pattern-specific variables:\tab {\uldb Pattern-specific}{\v Pattern_specific}.\par}{\fi-2880\li2880\tx2880pc <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880pc:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880phony targets:\tab {\uldb Phony Targets}{\v Phony_Targets}.\par}{\fi-2880\li2880\tx2880pitfalls of wildcards:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880portability:\tab {\uldb Features}{\v Features}.\par}{\fi-2880\li2880\tx2880POSIX:\tab {\uldb Overview}{\v Overview}.\par}{\fi-2880\li2880\tx2880POSIX.2:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880post-installation commands:\tab {\uldb Install Command Categories}{\v Install_Command_Categories}.\par}{\fi-2880\li2880\tx2880pre-installation commands:\tab {\uldb Install Command Categories}{\v Install_Command_Categories}.\par}{\fi-2880\li2880\tx2880precious targets:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880prefix, adding:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880prerequisite:\tab {\uldb Rules}{\v Rules}.\par}{\fi-2880\li2880\tx2880prerequisite pattern, implicit:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880prerequisite pattern, static (not implicit):\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880prerequisite, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880prerequisites:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880prerequisites, automatic generation <1>:\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880prerequisites, automatic generation:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880prerequisites, introduction to:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880prerequisites, list of all:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880prerequisites, list of changed:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880prerequisites, varying (static pattern):\tab {\uldb Static Pattern}{\v Static_Pattern}.\par}{\fi-2880\li2880\tx2880preserving intermediate files:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880preserving with {\f1{}.PRECIOUS} <1>:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880preserving with {\f1{}.PRECIOUS}:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880preserving with {\f1{}.SECONDARY}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880printing directories:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880printing of commands:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880printing user warnings:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880problems and bugs, reporting:\tab {\uldb Bugs}{\v Bugs}.\par}{\fi-2880\li2880\tx2880problems with wildcards:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880processing a makefile:\tab {\uldb How Make Works}{\v How_Make_Works}.\par}{\fi-2880\li2880\tx2880question mode:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880quoting newline, in commands:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880quoting newline, in makefile:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880quoting {\f1{}%}, in static pattern:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880quoting {\f1{}%}, in {\f1{}patsubst}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880quoting {\f1{}%}, in {\f1{}vpath}:\tab {\uldb Selective Search}{\v Selective_Search}.\par}{\fi-2880\li2880\tx2880Ratfor, rule to compile:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880RCS, rule to extract from:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880reading makefiles:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880recompilation:\tab {\uldb Introduction}{\v Introduction}.\par}{\fi-2880\li2880\tx2880recompilation, avoiding:\tab {\uldb Avoiding Compilation}{\v Avoiding_Compilation}.\par}{\fi-2880\li2880\tx2880recording events with empty targets:\tab {\uldb Empty Targets}{\v Empty_Targets}.\par}{\fi-2880\li2880\tx2880recursion:\tab {\uldb Recursion}{\v Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and command line variable definitions:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and environment:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and options:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and printing directories:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880recursion, and variables:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-C}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-f}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-j}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-o}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-t}:\tab {\uldb MAKE Variable}{\v MAKE_Variable}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-W}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}-w}:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}MAKEFILES} variable:\tab {\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}.\par}{\fi-2880\li2880\tx2880recursion, and {\f1{}MAKE} variable:\tab {\uldb MAKE Variable}{\v MAKE_Variable}.\par}{\fi-2880\li2880\tx2880recursion, level of:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880recursive variable expansion <1>:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880recursive variable expansion:\tab {\uldb Using Variables}{\v Using_Variables}.\par}{\fi-2880\li2880\tx2880recursively expanded variables:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880reference to variables <1>:\tab {\uldb Reference}{\v Reference}.\par}{\fi-2880\li2880\tx2880reference to variables:\tab {\uldb Advanced}{\v Advanced}.\par}{\fi-2880\li2880\tx2880relinking:\tab {\uldb How Make Works}{\v How_Make_Works}.\par}{\fi-2880\li2880\tx2880remaking makefiles:\tab {\uldb Remaking Makefiles}{\v Remaking_Makefiles}.\par}{\fi-2880\li2880\tx2880removal of target files <1>:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880removal of target files:\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880removing duplicate words:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880removing targets on failure:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880removing, to clean up:\tab {\uldb Cleanup}{\v Cleanup}.\par}{\fi-2880\li2880\tx2880reporting bugs:\tab {\uldb Bugs}{\v Bugs}.\par}{\fi-2880\li2880\tx2880rm:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880rule commands:\tab {\uldb Commands}{\v Commands}.\par}{\fi-2880\li2880\tx2880rule prerequisites:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880rule syntax:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880rule targets:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880rule, and {\f1{}$}:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880rule, double-colon ({\f1{}::}):\tab {\uldb Double-Colon}{\v Double_Colon}.\par}{\fi-2880\li2880\tx2880rule, explicit, definition of:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880rule, how to write:\tab {\uldb Rules}{\v Rules}.\par}{\fi-2880\li2880\tx2880rule, implicit:\tab {\uldb Implicit Rules}{\v Implicit_Rules}.\par}{\fi-2880\li2880\tx2880rule, implicit, and directory search:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880rule, implicit, and {\f1{}VPATH}:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880rule, implicit, chains of:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880rule, implicit, definition of:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880rule, implicit, how to use:\tab {\uldb Using Implicit}{\v Using_Implicit}.\par}{\fi-2880\li2880\tx2880rule, implicit, introduction to:\tab {\uldb make Deduces}{\v make_Deduces}.\par}{\fi-2880\li2880\tx2880rule, implicit, predefined:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880rule, introduction to:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880rule, multiple for one target:\tab {\uldb Multiple Rules}{\v Multiple_Rules}.\par}{\fi-2880\li2880\tx2880rule, no commands or prerequisites:\tab {\uldb Force Targets}{\v Force_Targets}.\par}{\fi-2880\li2880\tx2880rule, pattern:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880rule, static pattern:\tab {\uldb Static Pattern}{\v Static_Pattern}.\par}{\fi-2880\li2880\tx2880rule, static pattern versus implicit:\tab {\uldb Static versus Implicit}{\v Static_versus_Implicit}.\par}{\fi-2880\li2880\tx2880rule, with multiple targets:\tab {\uldb Multiple Targets}{\v Multiple_Targets}.\par}{\fi-2880\li2880\tx2880s. (SCCS file prefix):\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880SCCS, rule to extract from:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880search algorithm, implicit rule:\tab {\uldb Implicit Rule Search}{\v Implicit_Rule_Search}.\par}{\fi-2880\li2880\tx2880search path for prerequisites ({\f1{}VPATH}):\tab {\uldb Directory Search}{\v Directory_Search}.\par}{\fi-2880\li2880\tx2880search path for prerequisites ({\f1{}VPATH}), and implicit rules:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880search path for prerequisites ({\f1{}VPATH}), and link libraries:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880searching for strings:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880secondary files:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880secondary targets:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880selecting a word:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880selecting word lists:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880sequences of commands:\tab {\uldb Sequences}{\v Sequences}.\par}{\fi-2880\li2880\tx2880setting options from environment:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880setting options in makefiles:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880setting variables:\tab {\uldb Setting}{\v Setting}.\par}{\fi-2880\li2880\tx2880several rules for one target:\tab {\uldb Multiple Rules}{\v Multiple_Rules}.\par}{\fi-2880\li2880\tx2880several targets in a rule:\tab {\uldb Multiple Targets}{\v Multiple_Targets}.\par}{\fi-2880\li2880\tx2880shell command:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880shell command, and directory search:\tab {\uldb Commands/Search}{\v Commands_Search}.\par}{\fi-2880\li2880\tx2880shell command, execution:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880shell command, function for:\tab {\uldb Shell Function}{\v Shell_Function}.\par}{\fi-2880\li2880\tx2880shell file name pattern (in {\f1{}include}):\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880shell wildcards (in {\f1{}include}):\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880signal:\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880silent operation:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880simple makefile:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880simple variable expansion:\tab {\uldb Using Variables}{\v Using_Variables}.\par}{\fi-2880\li2880\tx2880simplifying with variables:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880simply expanded variables:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880sorting words:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880spaces, in variable values:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880spaces, stripping:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880special targets:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880specifying makefile name:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880standard input:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880standards conformance:\tab {\uldb Overview}{\v Overview}.\par}{\fi-2880\li2880\tx2880standards for makefiles:\tab {\uldb Makefile Conventions}{\v Makefile_Conventions}.\par}{\fi-2880\li2880\tx2880static pattern rule:\tab {\uldb Static Pattern}{\v Static_Pattern}.\par}{\fi-2880\li2880\tx2880static pattern rule, syntax of:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880static pattern rule, versus implicit:\tab {\uldb Static versus Implicit}{\v Static_versus_Implicit}.\par}{\fi-2880\li2880\tx2880stem <1>:\tab {\uldb Pattern Match}{\v Pattern_Match}.\par}{\fi-2880\li2880\tx2880stem:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880stem, variable for:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880stopping make:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880strings, searching for:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880stripping whitespace:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880sub-{\f1{}make}:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880subdirectories, recursion for:\tab {\uldb Recursion}{\v Recursion}.\par}{\fi-2880\li2880\tx2880substitution variable reference:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880suffix rule:\tab {\uldb Suffix Rules}{\v Suffix_Rules}.\par}{\fi-2880\li2880\tx2880suffix rule, for archive:\tab {\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}.\par}{\fi-2880\li2880\tx2880suffix, adding:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880suffix, function to find:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880suffix, substituting in variables:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880switches:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880symbol directories, updating archive:\tab {\uldb Archive Symbols}{\v Archive_Symbols}.\par}{\fi-2880\li2880\tx2880syntax of rules:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880tab character (in commands):\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880tabs in rules:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880tangle <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880tangle:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880target:\tab {\uldb Rules}{\v Rules}.\par}{\fi-2880\li2880\tx2880target pattern, implicit:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880target pattern, static (not implicit):\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880target, deleting on error:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880target, deleting on interrupt:\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880target, expansion:\tab {\uldb Reading Makefiles}{\v Reading_Makefiles}.\par}{\fi-2880\li2880\tx2880target, multiple in pattern rule:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880target, multiple rules for one:\tab {\uldb Multiple Rules}{\v Multiple_Rules}.\par}{\fi-2880\li2880\tx2880target, touching:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880target-specific variables:\tab {\uldb Target-specific}{\v Target_specific}.\par}{\fi-2880\li2880\tx2880targets:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880targets without a file:\tab {\uldb Phony Targets}{\v Phony_Targets}.\par}{\fi-2880\li2880\tx2880targets, built-in special:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880targets, empty:\tab {\uldb Empty Targets}{\v Empty_Targets}.\par}{\fi-2880\li2880\tx2880targets, force:\tab {\uldb Force Targets}{\v Force_Targets}.\par}{\fi-2880\li2880\tx2880targets, introduction to:\tab {\uldb Rule Introduction}{\v Rule_Introduction}.\par}{\fi-2880\li2880\tx2880targets, multiple:\tab {\uldb Multiple Targets}{\v Multiple_Targets}.\par}{\fi-2880\li2880\tx2880targets, phony:\tab {\uldb Phony Targets}{\v Phony_Targets}.\par}{\fi-2880\li2880\tx2880terminal rule:\tab {\uldb Match-Anything Rules}{\v Match_Anything_Rules}.\par}{\fi-2880\li2880\tx2880testing compilation:\tab {\uldb Testing}{\v Testing}.\par}{\fi-2880\li2880\tx2880tex <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880tex:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880TeX, rule to run:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880texi2dvi <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880texi2dvi:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880Texinfo, rule to format:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880tilde ({\f1{}~}):\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880touching files:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880traditional directory search:\tab {\uldb Search Algorithm}{\v Search_Algorithm}.\par}{\fi-2880\li2880\tx2880undefined variables, warning message:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880updating archive symbol directories:\tab {\uldb Archive Symbols}{\v Archive_Symbols}.\par}{\fi-2880\li2880\tx2880updating makefiles:\tab {\uldb Remaking Makefiles}{\v Remaking_Makefiles}.\par}{\fi-2880\li2880\tx2880user defined functions:\tab {\uldb Call Function}{\v Call_Function}.\par}{\fi-2880\li2880\tx2880value:\tab {\uldb Using Variables}{\v Using_Variables}.\par}{\fi-2880\li2880\tx2880value, how a variable gets it:\tab {\uldb Values}{\v Values}.\par}{\fi-2880\li2880\tx2880variable:\tab {\uldb Using Variables}{\v Using_Variables}.\par}{\fi-2880\li2880\tx2880variable definition:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880variables:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880variables, and implicit rule:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880variables, appending to:\tab {\uldb Appending}{\v Appending}.\par}{\fi-2880\li2880\tx2880variables, automatic:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880variables, command line:\tab {\uldb Overriding}{\v Overriding}.\par}{\fi-2880\li2880\tx2880variables, command line, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880variables, computed names:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880variables, conditional assignment:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880variables, defining verbatim:\tab {\uldb Defining}{\v Defining}.\par}{\fi-2880\li2880\tx2880variables, environment <1>:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880variables, environment:\tab {\uldb Environment}{\v Environment}.\par}{\fi-2880\li2880\tx2880variables, exporting:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880variables, flavors:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880variables, how they get their values:\tab {\uldb Values}{\v Values}.\par}{\fi-2880\li2880\tx2880variables, how to reference:\tab {\uldb Reference}{\v Reference}.\par}{\fi-2880\li2880\tx2880variables, loops in expansion:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880variables, modified reference:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880variables, nested references:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880variables, origin of:\tab {\uldb Origin Function}{\v Origin_Function}.\par}{\fi-2880\li2880\tx2880variables, overriding:\tab {\uldb Override Directive}{\v Override_Directive}.\par}{\fi-2880\li2880\tx2880variables, overriding with arguments:\tab {\uldb Overriding}{\v Overriding}.\par}{\fi-2880\li2880\tx2880variables, pattern-specific:\tab {\uldb Pattern-specific}{\v Pattern_specific}.\par}{\fi-2880\li2880\tx2880variables, recursively expanded:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880variables, setting:\tab {\uldb Setting}{\v Setting}.\par}{\fi-2880\li2880\tx2880variables, simply expanded:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880variables, spaces in values:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880variables, substituting suffix in:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880variables, substitution reference:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880variables, target-specific:\tab {\uldb Target-specific}{\v Target_specific}.\par}{\fi-2880\li2880\tx2880variables, warning for undefined:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880variables, {\f1{}$} in name:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880varying prerequisites:\tab {\uldb Static Pattern}{\v Static_Pattern}.\par}{\fi-2880\li2880\tx2880verbatim variable definition:\tab {\uldb Defining}{\v Defining}.\par}{\fi-2880\li2880\tx2880vpath:\tab {\uldb Directory Search}{\v Directory_Search}.\par}{\fi-2880\li2880\tx2880warnings, printing:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880weave <1>:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880weave:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880Web, rule to run:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880what if:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880whitespace, in variable values:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880whitespace, stripping:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880wildcard:\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880wildcard pitfalls:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880wildcard, function:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880wildcard, in archive member:\tab {\uldb Archive Members}{\v Archive_Members}.\par}{\fi-2880\li2880\tx2880wildcard, in {\f1{}include}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880wildcards and MS-DOS/MS-Windows backslashes:\tab {\uldb Wildcard Pitfall}{\v Wildcard_Pitfall}.\par}{\fi-2880\li2880\tx2880word, selecting a:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880words, extracting first:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880words, filtering:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880words, filtering out:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880words, finding number:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880words, iterating over:\tab {\uldb Foreach Function}{\v Foreach_Function}.\par}{\fi-2880\li2880\tx2880words, joining lists:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880words, removing duplicates:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880words, selecting lists of:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880writing rule commands:\tab {\uldb Commands}{\v Commands}.\par}{\fi-2880\li2880\tx2880writing rules:\tab {\uldb Rules}{\v Rules}.\par}{\fi-2880\li2880\tx2880yacc <1>:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880yacc:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880Yacc, rule to run:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}#include}:\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}#} (comments), in commands:\tab {\uldb Commands}{\v Commands}.\par}{\fi-2880\li2880\tx2880{\f1{}#} (comments), in makefile:\tab {\uldb Makefile Contents}{\v Makefile_Contents}.\par}{\fi-2880\li2880\tx2880{\f1{}$}, in function call:\tab {\uldb Syntax of Functions}{\v Syntax_of_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}$}, in rules:\tab {\uldb Rule Syntax}{\v Rule_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}$}, in variable name:\tab {\uldb Computed Names}{\v Computed_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}$}, in variable reference:\tab {\uldb Reference}{\v Reference}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, in pattern rules:\tab {\uldb Pattern Intro}{\v Pattern_Intro}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, quoting in static pattern:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, quoting in {\f1{}patsubst}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, quoting in {\f1{}vpath}:\tab {\uldb Selective Search}{\v Selective_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, quoting with {\f1{}\'5C} (backslash) <1>:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, quoting with {\f1{}\'5C} (backslash) <2>:\tab {\uldb Selective Search}{\v Selective_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}%}, quoting with {\f1{}\'5C} (backslash):\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880{\f1{}*} (wildcard character):\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880{\f1{}--assume-new} <1>:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--assume-new}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--assume-new}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--assume-old} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--assume-old}:\tab {\uldb Avoiding Compilation}{\v Avoiding_Compilation}.\par}{\fi-2880\li2880\tx2880{\f1{}--assume-old}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--debug}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--directory} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--directory}:\tab {\uldb Recursion}{\v Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--directory}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--directory}, and {\f1{}--print-directory}:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}--dry-run} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--dry-run} <2>:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}--dry-run}:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--environment-overrides}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--file} <1>:\tab {\uldb Makefile Arguments}{\v Makefile_Arguments}.\par}{\fi-2880\li2880\tx2880{\f1{}--file} <2>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--file}:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}--file}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--help}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--ignore-errors} <1>:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}--ignore-errors}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--include-dir} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--include-dir}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880{\f1{}--jobs} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--jobs}:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880{\f1{}--jobs}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--just-print} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--just-print} <2>:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--just-print}:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}--keep-going} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--keep-going} <2>:\tab {\uldb Testing}{\v Testing}.\par}{\fi-2880\li2880\tx2880{\f1{}--keep-going}:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}--load-average} <1>:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880{\f1{}--load-average}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--makefile} <1>:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}--makefile} <2>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--makefile}:\tab {\uldb Makefile Arguments}{\v Makefile_Arguments}.\par}{\fi-2880\li2880\tx2880{\f1{}--max-load} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--max-load}:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880{\f1{}--new-file} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--new-file}:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--new-file}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--no-builtin-rules}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--no-builtin-variables}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--no-keep-going}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--no-print-directory} <1>:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}--no-print-directory}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--old-file} <1>:\tab {\uldb Avoiding Compilation}{\v Avoiding_Compilation}.\par}{\fi-2880\li2880\tx2880{\f1{}--old-file}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--old-file}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}--print-data-base}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--print-directory}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--print-directory}, and recursion:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}--print-directory}, and {\f1{}--directory}:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}--print-directory}, disabling:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}--question} <1>:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--question}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--quiet} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--quiet}:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}--recon} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--recon} <2>:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}--recon}:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--silent} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--silent}:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}--stop}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--touch} <1>:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}--touch}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--touch}, and recursion:\tab {\uldb MAKE Variable}{\v MAKE_Variable}.\par}{\fi-2880\li2880\tx2880{\f1{}--version}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--warn-undefined-variables}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--what-if} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}--what-if}:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}-b}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-C} <1>:\tab {\uldb Recursion}{\v Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}-C}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-C}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}-C}, and {\f1{}-w}:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}-d}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-e}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-e} (shell flag):\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}-f} <1>:\tab {\uldb Makefile Arguments}{\v Makefile_Arguments}.\par}{\fi-2880\li2880\tx2880{\f1{}-f} <2>:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}-f}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-f}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}-h}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-I}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880{\f1{}-i}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-I}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-i}:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}-j} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-j}:\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880{\f1{}-j}, and archive update:\tab {\uldb Archive Pitfalls}{\v Archive_Pitfalls}.\par}{\fi-2880\li2880\tx2880{\f1{}-j}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}-k} <1>:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}-k} <2>:\tab {\uldb Testing}{\v Testing}.\par}{\fi-2880\li2880\tx2880{\f1{}-k}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-l}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-l} (library search):\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}-l} (load average):\tab {\uldb Parallel}{\v Parallel}.\par}{\fi-2880\li2880\tx2880{\f1{}-MM} (to GNU compiler):\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}-m}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-M} (to compiler):\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}-n} <1>:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}-n} <2>:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}-n}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-o} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-o}:\tab {\uldb Avoiding Compilation}{\v Avoiding_Compilation}.\par}{\fi-2880\li2880\tx2880{\f1{}-o}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}-p}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-q} <1>:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}-q}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-r}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-R}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-s}:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}-S}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-s}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-t} <1>:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-t}:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}-t}, and recursion:\tab {\uldb MAKE Variable}{\v MAKE_Variable}.\par}{\fi-2880\li2880\tx2880{\f1{}-v}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-W}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-w}:\tab {\uldb Options Summary}{\v Options_Summary}.\par}{\fi-2880\li2880\tx2880{\f1{}-W}:\tab {\uldb Instead of Execution}{\v Instead_of_Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}-w}, and recursion:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}-W}, and recursion:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}-w}, and {\f1{}-C}:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}-w}, disabling:\tab {\uldb -w Option}{\v _w_Option}.\par}{\fi-2880\li2880\tx2880{\f1{}-} (in commands):\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}.a} (archives):\tab {\uldb Archive Suffix Rules}{\v Archive_Suffix_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}.d}:\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}.LIBPATTERNS}, and link libraries:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}.PRECIOUS} intermediate files:\tab {\uldb Chained Rules}{\v Chained_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}::} rules (double-colon):\tab {\uldb Double-Colon}{\v Double_Colon}.\par}{\fi-2880\li2880\tx2880{\f1{}?} (wildcard character):\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880{\f1{}@} (in commands):\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}[...]} (wildcard characters):\tab {\uldb Wildcards}{\v Wildcards}.\par}{\fi-2880\li2880\tx2880{\f1{}\'5C} (backslash), for continuation lines:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880{\f1{}\'5C} (backslash), in commands:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}\'5C} (backslash), to quote {\f1{}%} <1>:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}\'5C} (backslash), to quote {\f1{}%} <2>:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880{\f1{}\'5C} (backslash), to quote {\f1{}%}:\tab {\uldb Selective Search}{\v Selective_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}__.SYMDEF}:\tab {\uldb Archive Symbols}{\v Archive_Symbols}.\par}{\fi-2880\li2880\tx2880{\f1{}all} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}cd} (shell command) <1>:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}cd} (shell command):\tab {\uldb MAKE Variable}{\v MAKE_Variable}.\par}{\fi-2880\li2880\tx2880{\f1{}check} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}clean} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}clean} target <1>:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880{\f1{}clean} target:\tab {\uldb Cleanup}{\v Cleanup}.\par}{\fi-2880\li2880\tx2880{\f1{}clobber} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}distclean} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}dist} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}FORCE}:\tab {\uldb Force Targets}{\v Force_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}install} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}lint}, rule to run:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}lpr} (shell command) <1>:\tab {\uldb Wildcard Examples}{\v Wildcard_Examples}.\par}{\fi-2880\li2880\tx2880{\f1{}lpr} (shell command):\tab {\uldb Empty Targets}{\v Empty_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}make depend}:\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKECMDGOALS}:\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}mostlyclean} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}objects}:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880{\f1{}OBJECTS}:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880{\f1{}objs}:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880{\f1{}OBJS}:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880{\f1{}obj}:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880{\f1{}OBJ}:\tab {\uldb Variables Simplify}{\v Variables_Simplify}.\par}{\fi-2880\li2880\tx2880{\f1{}print} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}print} target <1>:\tab {\uldb Wildcard Examples}{\v Wildcard_Examples}.\par}{\fi-2880\li2880\tx2880{\f1{}print} target:\tab {\uldb Empty Targets}{\v Empty_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}README}:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}realclean} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}rm} (shell command) <1>:\tab {\uldb Wildcard Examples}{\v Wildcard_Examples}.\par}{\fi-2880\li2880\tx2880{\f1{}rm} (shell command) <2>:\tab {\uldb Simple Makefile}{\v Simple_Makefile}.\par}{\fi-2880\li2880\tx2880{\f1{}rm} (shell command) <3>:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}rm} (shell command):\tab {\uldb Phony Targets}{\v Phony_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}sed} (shell command):\tab {\uldb Automatic Prerequisites}{\v Automatic_Prerequisites}.\par}{\fi-2880\li2880\tx2880{\f1{}shar} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}SHELL}, MS-DOS specifics:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}TAGS} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}tar} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}test} (standard target):\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}touch} (shell command) <1>:\tab {\uldb Wildcard Examples}{\v Wildcard_Examples}.\par}{\fi-2880\li2880\tx2880{\f1{}touch} (shell command):\tab {\uldb Empty Targets}{\v Empty_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}VPATH}, and implicit rules:\tab {\uldb Implicit/Search}{\v Implicit_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}VPATH}, and link libraries:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}yacc}:\tab {\uldb Sequences}{\v Sequences}.\par}{\fi-2880\li2880\tx2880{\f1{}~} (tilde):\tab {\uldb Wildcards}{\v Wildcards}.\par}\page\pard Node: {\b Name Index}, \keepn Next: {\uldb }{\v }, Prev: {\uldb Concept Index}{\v Concept_Index}, Up: {\uldb Top}{\v Top}\line
K{\footnote K Name Index}
#{\footnote Name_Index}
${\footnote \pard{}Index of Functions, Variables, & Directives}\par
\pard{\fs24\b Index of Functions, Variables, & Directives}\par
\par
{\fi-2880\li2880\tx2880{\f1{}$%}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(%D)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(%F)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(*D)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(*F)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(<D)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(<F)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(?D)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(?F)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(@D)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(@F)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(^D)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$(^F)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$*, and static pattern}:\tab {\uldb Static Usage}{\v Static_Usage}.\par}{\fi-2880\li2880\tx2880{\f1{}$*}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$+}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$<}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$?}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$@}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}$^}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}% (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}%D (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}%F (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}* (automatic variable), unsupported bizarre usage}:\tab {\uldb Missing}{\v Missing}.\par}{\fi-2880\li2880\tx2880{\f1{}* (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}*D (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}*F (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}+ (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}.DEFAULT, and empty commands}:\tab {\uldb Empty Commands}{\v Empty_Commands}.\par}{\fi-2880\li2880\tx2880{\f1{}.DEFAULT} <1>:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.DEFAULT}:\tab {\uldb Last Resort}{\v Last_Resort}.\par}{\fi-2880\li2880\tx2880{\f1{}.DELETE_ON_ERROR} <1>:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}.DELETE_ON_ERROR}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.EXPORT_ALL_VARIABLES} <1>:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}.EXPORT_ALL_VARIABLES}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.IGNORE} <1>:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.IGNORE}:\tab {\uldb Errors}{\v Errors}.\par}{\fi-2880\li2880\tx2880{\f1{}.INTERMEDIATE}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.LIBPATTERNS}:\tab {\uldb Libraries/Search}{\v Libraries_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}.PHONY} <1>:\tab {\uldb Phony Targets}{\v Phony_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.PHONY}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.POSIX}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}.PRECIOUS} <1>:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.PRECIOUS}:\tab {\uldb Interrupts}{\v Interrupts}.\par}{\fi-2880\li2880\tx2880{\f1{}.SECONDARY}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.SILENT} <1>:\tab {\uldb Echoing}{\v Echoing}.\par}{\fi-2880\li2880\tx2880{\f1{}.SILENT}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}.SUFFIXES} <1>:\tab {\uldb Suffix Rules}{\v Suffix_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}.SUFFIXES}:\tab {\uldb Special Targets}{\v Special_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}/usr/gnu/include}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880{\f1{}/usr/include}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880{\f1{}/usr/local/include}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880{\f1{}< (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}<D (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}<F (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}? (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}?D (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}?F (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}@ (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}@D (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}@F (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}^ (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}^D (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}^F (automatic variable)}:\tab {\uldb Automatic}{\v Automatic}.\par}{\fi-2880\li2880\tx2880{\f1{}addprefix}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}addsuffix}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}ARFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}AR}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}ASFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}AS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}basename}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}call}:\tab {\uldb Call Function}{\v Call_Function}.\par}{\fi-2880\li2880\tx2880{\f1{}CC}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}COFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}COMSPEC}:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}CO}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CPPFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CPP}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CTANGLE}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CWEAVE}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CXXFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}CXX}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}define}:\tab {\uldb Defining}{\v Defining}.\par}{\fi-2880\li2880\tx2880{\f1{}dir}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}else}:\tab {\uldb Conditional Syntax}{\v Conditional_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}endef}:\tab {\uldb Defining}{\v Defining}.\par}{\fi-2880\li2880\tx2880{\f1{}endif}:\tab {\uldb Conditional Syntax}{\v Conditional_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}error}:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}export}:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}FC}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}FFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}filter-out}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}filter}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}findstring}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}firstword}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}foreach}:\tab {\uldb Foreach Function}{\v Foreach_Function}.\par}{\fi-2880\li2880\tx2880{\f1{}GET}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}GFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}GNUmakefile}:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}GPATH}:\tab {\uldb Search Algorithm}{\v Search_Algorithm}.\par}{\fi-2880\li2880\tx2880{\f1{}ifdef}:\tab {\uldb Conditional Syntax}{\v Conditional_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}ifeq}:\tab {\uldb Conditional Syntax}{\v Conditional_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}ifndef}:\tab {\uldb Conditional Syntax}{\v Conditional_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}ifneq}:\tab {\uldb Conditional Syntax}{\v Conditional_Syntax}.\par}{\fi-2880\li2880\tx2880{\f1{}if}:\tab {\uldb If Function}{\v If_Function}.\par}{\fi-2880\li2880\tx2880{\f1{}include}:\tab {\uldb Include}{\v Include}.\par}{\fi-2880\li2880\tx2880{\f1{}join}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}LDFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}LEX}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}LFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKECMDGOALS}:\tab {\uldb Goals}{\v Goals}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKEFILES} <1>:\tab {\uldb MAKEFILES Variable}{\v MAKEFILES_Variable}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKEFILES}:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}makefile}:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}Makefile}:\tab {\uldb Makefile Names}{\v Makefile_Names}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKEFLAGS}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKEINFO}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKELEVEL} <1>:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKELEVEL}:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKEOVERRIDES}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKE} <1>:\tab {\uldb Flavors}{\v Flavors}.\par}{\fi-2880\li2880\tx2880{\f1{}MAKE}:\tab {\uldb MAKE Variable}{\v MAKE_Variable}.\par}{\fi-2880\li2880\tx2880{\f1{}MFLAGS}:\tab {\uldb Options/Recursion}{\v Options_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}notdir}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}origin}:\tab {\uldb Origin Function}{\v Origin_Function}.\par}{\fi-2880\li2880\tx2880{\f1{}OUTPUT_OPTION}:\tab {\uldb Catalogue of Rules}{\v Catalogue_of_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}override}:\tab {\uldb Override Directive}{\v Override_Directive}.\par}{\fi-2880\li2880\tx2880{\f1{}patsubst} <1>:\tab {\uldb Substitution Refs}{\v Substitution_Refs}.\par}{\fi-2880\li2880\tx2880{\f1{}patsubst}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}PC}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}PFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}RFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}RM}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}SHELL (command execution)}:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}shell}:\tab {\uldb Shell Function}{\v Shell_Function}.\par}{\fi-2880\li2880\tx2880{\f1{}SHELL}:\tab {\uldb Execution}{\v Execution}.\par}{\fi-2880\li2880\tx2880{\f1{}sort}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}strip}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}subst} <1>:\tab {\uldb Multiple Targets}{\v Multiple_Targets}.\par}{\fi-2880\li2880\tx2880{\f1{}subst}:\tab {\uldb Text Functions}{\v Text_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}SUFFIXES}:\tab {\uldb Suffix Rules}{\v Suffix_Rules}.\par}{\fi-2880\li2880\tx2880{\f1{}suffix}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}TANGLE}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}TEXI2DVI}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}TEX}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}unexport}:\tab {\uldb Variables/Recursion}{\v Variables_Recursion}.\par}{\fi-2880\li2880\tx2880{\f1{}VPATH}:\tab {\uldb General Search}{\v General_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}vpath} <1>:\tab {\uldb Selective Search}{\v Selective_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}vpath}:\tab {\uldb Directory Search}{\v Directory_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}VPATH}:\tab {\uldb Directory Search}{\v Directory_Search}.\par}{\fi-2880\li2880\tx2880{\f1{}warning}:\tab {\uldb Make Control Functions}{\v Make_Control_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}WEAVE}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}wildcard} <1>:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}wildcard}:\tab {\uldb Wildcard Function}{\v Wildcard_Function}.\par}{\fi-2880\li2880\tx2880{\f1{}wordlist}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}words}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}word}:\tab {\uldb File Name Functions}{\v File_Name_Functions}.\par}{\fi-2880\li2880\tx2880{\f1{}YACCR}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}YACC}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}{\fi-2880\li2880\tx2880{\f1{}YFLAGS}:\tab {\uldb Implicit Variables}{\v Implicit_Variables}.\par}\page K{\footnote Makertf}#{\footnote hcMakertf}${\footnote \pard{}About Makertf}\pard{\fs24\b About Makertf}\par\par\pard{}Makertf is a program that converts "Texinfo" files into "Rich Text Format" (RTF) files. It can be used to make WinHelp Files from GNU manuals and other documentation written in Texinfo. Visit http://www.snafu.de/~cschenk/makertf for more information.}